Post

Replies

Boosts

Views

Activity

Reply to File System vs Core Data for persisting data
adding to Claude31, SwuiftUI's @FetchedResults, and the underlying NSFetchedResultsController, are IMHO a key reason to adopt CoreData: changes in the background at the model layer get signaled to the main thread view layer, which can then be dynamically updated. The other reason to use CoreData is enabling device-to-device synchronization (for a user with multiple devices, or data shared between users) via NSPersistentCloudKitContainer (or an open-source sync engine like CloudCore).
Mar ’22
Reply to Is there an easy workflow for Skeleton tracking?
iOS SDK provides the building blocks, we have to build the solutions. I too am working on a body tracking app (and I've released an open source lib for recording and playback https://github.com/deeje/AVBody ) And I think the solution is to build a companion watch app, a la Camera.app, that shows a slow frame rate video feed, and buttons to start/stop recording. fwiw
Topic: Spatial Computing SubTopic: ARKit Tags:
Apr ’22
Reply to CoreData concurrency debug
The debugger is working! ;-) Managed objects should never cross thread boundaries, and accessing attributes from a managed object outside of the context in which is was created or fetched can cause crashes. The call to completion(result) should be within the the self.backgroundContext.performAndWait block.
Apr ’22
Reply to Saving images & video to Core Data (with CloudKit)
Syncing large data files in CoreData<->CloudKit is particularly challenging. If you just store data in Binary Data attributes, that get converted into CKAssets, then fetching and modifying those CKRecords can take a long time, and potentially timeout, particularly if the user backgrounds the app and it gets suspended. To my knowledge, NSPersistentCloudKitContainer does use background tasks for syncing, but these aren't the same as long-lived operations, which are handled outside of the app. I've been pondering these issues for a while now, and have been working on an update to an open-source sync engine called CloudCore, with support for Cacheable Assets. Its a bit complex to establish your schema and code, but once done, large files you associate with CoreData managed objects are uploaded and downloaded using long-lived operations. The feature isn't quite ready yet, still doing some real-world testing, but you can see the progress here… https://github.com/deeje/CloudCore/pull/28 and feel free to check out the branch here… https://github.com/deeje/CloudCore/tree/feature/Cacheable
Topic: Programming Languages SubTopic: Swift Tags:
May ’22