Unified detail views, model

This commit is contained in:
Christoph Hagen
2024-12-16 09:54:21 +01:00
parent 1e67a99866
commit 31d1ecb8bd
57 changed files with 853 additions and 954 deletions

View File

@ -435,12 +435,15 @@ final class Storage {
// MARK: Folder access
func save(folderUrl url: URL, in bookmark: SecurityScopeBookmark) {
@discardableResult
func save(folderUrl url: URL, in bookmark: SecurityScopeBookmark) -> Bool {
do {
let bookmarkData = try url.bookmarkData(options: .withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil)
UserDefaults.standard.set(bookmarkData, forKey: bookmark.rawValue)
return true
} catch {
print("Failed to create security-scoped bookmark: \(error)")
return false
}
}