'How can I test a bookmark to a URL going stale?
I'm having some problems in my iOS app with bookmarked URL's (which are originally imported through UIDocumentPickerViewController) apparently going stale, because user's are complaining about not being able to access them after some time.
I think this might be a problem on my end because I'm not necessarily following the advice to create a new bookmark if the URL init method indicates the bookmark is stale.
My question is, how do I cause a bookmark to go stale so I can test if I correctly update the stale bookmark? I've tried going into the Files app on the device and moving the file into different locations in 'On My iPhone', but the bookmarkDataIsStale parameter is still false even after restarting the app and the resolved url works fine.
var bookmarkIsStale = false
if let bookmark = item.bookmark {
item.assetURL = try URL(resolvingBookmarkData: bookmark, bookmarkDataIsStale: &bookmarkIsStale)
if bookmarkIsStale { print("STALE \(item.title)") }
}
How do I make bookmarkIsStale become true?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
