Skip to content

Instantly share code, notes, and snippets.

@Koze
Last active October 10, 2018 02:52
Show Gist options
  • Save Koze/81f1127bb0d50c5fff7e to your computer and use it in GitHub Desktop.
Save Koze/81f1127bb0d50c5fff7e to your computer and use it in GitHub Desktop.
How to use WKWebsiteDataStore and WKWebsiteDataRecord.
- (void)showAllRecords
{
WKWebsiteDataStore *dateStore = [WKWebsiteDataStore defaultDataStore];
[dateStore fetchDataRecordsOfTypes:[WKWebsiteDataStore allWebsiteDataTypes]
completionHandler:^(NSArray<WKWebsiteDataRecord *> * __nonnull records) {
// display records to user
}];
}
// argument is a record that user selected.
- (void)removeRecord:(WKWebsiteDataRecord *)record {
WKWebsiteDataStore *dateStore = [WKWebsiteDataStore defaultDataStore];
[dateStore removeDataOfTypes:record.dataTypes
forDataRecords:@[record]
completionHandler:^{
}];
}
@Jackylee1992
Copy link

I want to know, too. : )

@shauket
Copy link

shauket commented Oct 10, 2018

Any success :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment