Post

Replies

Boosts

Views

Activity

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 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 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 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 Core Data and FetchedResultsController bugged behaviour after application crash (or forced exit)
this code is losing the managed object context: func performInBackground(operation: BackgroundOperation) { container.performBackgroundTask { context in self.backgroundQueue.async { operation.execute(context: context) } } } you don't need backgroundQueue. it should be this instead… func performInBackground(operation: BackgroundOperation) { container.performBackgroundTask { context in operation.execute(context: context) } }
Topic: App & System Services SubTopic: Core OS Tags:
May ’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
Replies
Boosts
Views
Activity
Jan ’23
Reply to Testing CloudKit App with TestFlight vs development devices
Are you pushing your schema (changes) from Development to Production in CloudKit?
Replies
Boosts
Views
Activity
Jan ’23
Reply to CloudKit Why is my Public Database empty?
Have you pushed your schema (changes) from Development to Production in CloudKit?
Replies
Boosts
Views
Activity
Jan ’23
Reply to CloudKit JS issue with Advanced Data Protection
You can re-enable web access to iCloud, but you'll have to sign into iCloud alongside using an existing iCloud-connected device to generate temporary access keys for your web session. Unclear to me so far if this extends to all/any CloudKit JS clients.
Replies
Boosts
Views
Activity
Jan ’23
Reply to CloudKit Web Services still supported?
the documentation may be archived, but CloudKit itself is not deprecated.
Replies
Boosts
Views
Activity
Jan ’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:
Replies
Boosts
Views
Activity
Feb ’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
Replies
Boosts
Views
Activity
Feb ’23
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:
Replies
Boosts
Views
Activity
Mar ’23
Reply to WKInterfaceSCNScene works fine on simulator, but delayed start on watch
its a simulator, not an emulator, so yes you definitely need to code and test this on device.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Possible to get a catalog song by matching song title and artistName?
Yes use CatalogSearchRequest and pass in the search term as "(title)+(artist)"
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Using MusicKit to play a song but not add it to user’s music history
Yes. Songs do not need to be in the library in order to play them. To ensure what is played does not appear at all to the user in the Music app, use the ApplicationMusicPlayer.
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Accessing SubViews in SwiftUI, as seen in UIKit
you might try embedding your SwiftUI inside UIKit with UIHostingConfiguration… semi.dev did a nice writeup: https://hemi.dev/uihostingconfiguration/
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Apple Music (MusicKit) + AVAudioEngine
my experience has been that paid music gives me binary data, but subscription music does not
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Core Data and FetchedResultsController bugged behaviour after application crash (or forced exit)
this code is losing the managed object context: func performInBackground(operation: BackgroundOperation) { container.performBackgroundTask { context in self.backgroundQueue.async { operation.execute(context: context) } } } you don't need backgroundQueue. it should be this instead… func performInBackground(operation: BackgroundOperation) { container.performBackgroundTask { context in operation.execute(context: context) } }
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to CloudKit backed SwiftData @Relationship
it should work, and if not, file a bug report
Replies
Boosts
Views
Activity
Jun ’23