Post

Replies

Boosts

Views

Activity

Reply to Items are not updated on UI after updating them in Core Data
fwiw, I still can't see enough of your code to determine the issue, but… One reason that your code may not be seeing changes is that all three views are probably using the same view (main thread managed object) context, and you're saving changes on that same context, so there's no signaling that changes are being made. If you're going to invest time into Core Data, I highly recommend mastering NSFetchedResultsControllers and using background contexts to change data (adds, edits, deletes). I even wrote an article about it! Hope it helps. https://medium.com/@deeje/practical-ios-architecture-coredata-cloudkit-lists-and-editors-638c87d382d3
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’23
Reply to How can I conform NSSecureCoding in my Core Data entity class
The fundamental challenge with using Codable with Core Data entities is that, when you instantiate an entity, it must be within a current managed object context (and its thread). I have seen lots of articles written by others who tackled the challenge. e.g. https://medium.com/swlh/core-data-using-codable-68660dfb5ce8 https://medium.com/@andrea.prearo/working-with-codable-and-core-data-83983e77198e https://www.hackingwithswift.com/forums/100-days-of-swiftui/day-61-my-solution-to-make-core-data-conform-to-codable/2434
Feb ’23
Reply to SwiftUI: Performance problems List of TextField
The stuttering is likely the allocation of new TextViews. fwiw, SwiftUI is still rather new compared to UIKit. UIKit includes TableView and CollectionView, which are designed to display, and scroll thru, large lists and grids of lots of things very efficiently. It does this by re-using a limited pool of "cell" views. SwiftUI currently does not expose this. It does have LazyH and LazyV, which means that the lazy views aren't instantiated until they are displayed, but they are not re-used.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’23
Reply to CloudKit how do I check for access level (public read, public write, private)
to determine if a user is signed into iCloud, use CKContainer.accountStatus { … } https://developer.apple.com/documentation/cloudkit/ckcontainer/1399180-accountstatuswithcompletionhandl Going further, record types in CloudKit can have various read and write permissions using security roles. CloudKit Security Roles are not well documented. See this thread for more https://stackoverflow.com/questions/31369181/how-do-the-cloudkit-security-roles-and-permissions-work
Jan ’23
Reply to In-app storage/sync strategy for shared objects
How important is user privacy? How important is security? How are you planning to pay for cloud services like FireBase or AppWrite? I choose CloudKit (and CoreData), time and again, because, user data is private and secure by default, the capability to share between users is built in on top of that privacy and security, and users pay for their own cloud storage, not me. In 2019, Apple introduced a sync system between the CloudKit and CoreData, called NSPersistentCloudKitContainer, which might server you well. If you want more control, check out CloudCore. And for Android, check out cloudkit_flutter. fwiw
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’23