@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
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 每个人都是幸福的,只是你的幸福常常在别人眼里! 今天晨读分享的书是《崭新的理所当然》。 作者松浦弥太郎,被誉为“日...