Skip to content

Releases: Kosikowski/swift-bookmarks

0.2.1

Choose a tag to compare

@Kosikowski Kosikowski released this 04 Oct 22:17
1396eed

Removes the library's only statfs call, so an app using it can describe the library accurately in its privacy manifest. See CHANGELOG.md for the full entry.

Changed

  • ItemInspecting.itemExists(withIdentity:) reads the volume's filesystem ID with getattrlist (ATTR_CMN_FSID) instead of statfs. Apple lists statfs among the disk-space APIs a privacy manifest has to give a reason for, and none of that category's reasons covers reading a filesystem ID. getattrlist is a file timestamp API, the category itemExists(atPath:)'s lstat already needs, so an app declares one category for both.
  • The README has a "Privacy manifest" section listing the two categories an app declares for the library (file timestamps, 3B52.1; user defaults, CA92.1 or 1C8F.1), and its installation snippet points at 0.2.1.

Compatibility

  • No API change. On macOS, itemExists(withIdentity:) returns the same answers; if getattrlist can't read the volume it returns nil (can't tell), as a failed statfs did.

0.2.0

Choose a tag to compare

@Kosikowski Kosikowski released this 29 Sep 14:56
41e69a8

Closes the gaps found while adopting swift-bookmarks in an app. See CHANGELOG.md for the full list.

Added

  • Document history store: path-only records (add(pathOnly:key:metadata:)), lastUsedAt and pinning, eviction policies (.storeOrder, .leastRecentlyUsed, .goneFirst, custom), an evictions() stream, updateLastKnownPath(_:to:), forget(where:) and a synchronous snapshot.
  • One-shot grant access: beginAccess(to:) and withAccess(to:_:) use a granted item without making a bookmark.
  • Document-scoped bookmarks and atomic saves: DocumentBookmarks.replaceDocument(_:) and replaceDocument(with:) replace the anchor while keeping the key the bookmarks need.
  • Re-granting off the Mac: regrantWithDocumentPicker (UIKit) and the bookmarkRegrant SwiftUI modifier on every platform; bookmarkImporter honours its configuration and reports onCancel.
  • BookmarksTesting: FakeBookmarkEngine simulates the host platform by default, and clearScriptedFailures(of:) removes scripted failures.

Fixed

  • In the App Sandbox a bookmark to a deleted item fails with 259; with nothing at the recorded path it is now .missing, not .needsRegrant.
  • times: 0 in failure scripts no longer fails once.

Compatibility

  • BookmarkRecord.data is now optional (nil for a path-only record), which breaks code that reads it.
  • ItemInspecting gains itemExists(withIdentity:), with a default implementation.
  • FakeBookmarkEngine() now simulates iOS, visionOS or Catalyst on those hosts.

0.1.0

Choose a tag to compare

@Kosikowski Kosikowski released this 24 Sep 07:40

First release of swift-bookmarks: URL bookmarks and security-scoped access for macOS 15, Mac Catalyst 18, iOS 18 and visionOS 2, in Swift 6.

Products

  • Bookmarks: every bookmark kind (app-scoped, document-scoped, implicit, reference, alias), typed failures, stale refresh inside the open scope, access leases that balance themselves, and an actor-based BookmarkStore with pluggable persistence (in memory, UserDefaults, a JSON file that can be shared between processes).
  • BookmarksUI: open panel and document picker, SwiftUI importer and drop destination, and a re-grant flow.
  • BookmarksTesting: FakeBookmarkEngine with a simulated file system, sandbox rules and access accounting, and ScriptedPersistence for storage failures.

Notes

  • This is a 0.x release: the API may still change before 1.0.
  • swift test runs outside the App Sandbox. The IntegrationHost app checks sandbox behaviour and is run by hand.
  • See the README for usage and docs/design.md for the design.