Contents

simonnickel/snap-swift-data

> This package is part of the [SNAP](https://github.com/simonnickel/snap) suite.

Features

  • Extensions

-- ModelContext.existingModel(for:) -- NSManagedObjectID+PersistentIdentifier (by https://useyourloaf.com/blog/swiftdata-fetching-an-existing-object/)

  • Persistent History Tracking (https://fatbobman.com/en/posts/persistent-history-tracking-in-swiftdata/)
  • DataManager: A wrapper around ModelContainer with Persistent History Tracking.

Disclaimer

The implementation relies on current CoreData / SwiftData implementation details. This means it might break with future versions of SwiftData. Please use carefully.

Nothing in this package should not be necessary at all and be supported by SwiftData (FB13577205).

Good to know

Add to launch arguments to silence CloudKit logs (see https://useyourloaf.com/blog/disabling-core-data-cloudkit-logging/):

-com.apple.CoreData.Logging.stderr 0

Package Metadata

Repository: simonnickel/snap-swift-data

Default branch: main

README: README.md