@interface WKWebsiteDataStore : NSObject <NSCoding>
/* @abstract Returns the default data store. */
+ (WKWebsiteDataStore *)defaultDataStore;
/** @abstract Returns a new non-persistent data store.
@discussion If a WKWebView is associated with a non-persistent data store, no data will
be written to the file system. This is useful for implementing "private browsing" in a web view.
*/
+ (WKWebsiteDataStore *)nonPersistentDataStore;
- (instancetype)init NS_UNAVAILABLE;
/*! @abstract Whether the data store is persistent or not. */
@property (nonatomic, readonly, getter=isPersistent) BOOL persistent;
/*! @abstract Returns a set of all available website data types. */
+ (NSSet<NSString *> *)allWebsiteDataTypes;
/*! @abstract Fetches data records containing the given website data types.
@param dataTypes The website data types to fetch records for.
@param completionHandler A block to invoke when the data records have been fetched.
*/
- (void)fetchDataRecordsOfTypes:(NSSet<NSString *> *)dataTypes completionHandler:(void (^)(NSArray<WKWebsiteDataRecord *> *))completionHandler;
/*! @abstract Removes website data of the given types for the given data records.
@param dataTypes The website data types that should be removed.
@param dataRecords The website data records to delete website data for.
@param completionHandler A block to invoke when the website data for the records has been removed.
*/
- (void)removeDataOfTypes:(NSSet<NSString *> *)dataTypes forDataRecords:(NSArray<WKWebsiteDataRecord *> *)dataRecords completionHandler:(void (^)(void))completionHandler;
/*! @abstract Removes all website data of the given types that has been modified since the given date.
@param dataTypes The website data types that should be removed.
@param date A date. All website data modified after this date will be removed.
@param completionHandler A block to invoke when the website data has been removed.
*/
- (void)removeDataOfTypes:(NSSet<NSString *> *)websiteDataTypes modifiedSince:(NSDate *)date completionHandler:(void (^)(void))completionHandler;
@end
WKWebsiteDataStore
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。