the system will ask the user for permission only once on your behalf. after that, you can check the status of the account, and if its disabled, display a UI directing the user to Settings to change the permission.
Post
Replies
Boosts
Views
Activity
The short answer is, yes this is very possible. Years ago I ported an open-source particle emitter system into SceneKit and Metal using a SCNNode renderDelegate.
Your code snippets above don't show setting the colorAttachments or depthAttachmentPixelFormat on the MTLRenderPipelineDescriptor?
As you have discovered, you cannot ignore the threading requirements of CoreData or SwiftUI. If you retrieve objects in a background context/thread, you cannot access them in the main thread (ie SwiftUI).
How many FRCs are you instantiating? Can you do updates with one set of FRCs in background contexts, and then use another set in the viewContext? Have you tried setting the batching levels on your FRCs?
it should work, and if not, file a bug report
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)
}
}
my experience has been that paid music gives me binary data, but subscription music does not
you might try embedding your SwiftUI inside UIKit with UIHostingConfiguration… semi.dev did a nice writeup:
https://hemi.dev/uihostingconfiguration/
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.
Yes use CatalogSearchRequest and pass in the search term as "(title)+(artist)"
its a simulator, not an emulator, so yes you definitely need to code and test this on device.
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
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
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.
the documentation may be archived, but CloudKit itself is not deprecated.
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.