Post

Replies

Boosts

Views

Activity

Reply to Any SwiftData change updates every SwiftUI view
Thank you for confirming the behavior. It became a problem for me because my app is constructing a complex view model from my data model, and the frequent updates were using a lot of CPU on the main thread. Fixing the issue wasn't easy, but I managed it through a combination of design changes: My model objects cache the view model in a @Transient field. My data models notify the view models of changes. The view models provide a CurrentValueSubject for each relevant data property that publishes changes to that property. The view models perform their calculations in the background by subscribing to changes in other view models. The view models are also @Observable, and they modify an observable property when the result of a calculation changes. My SwiftUI views observe the view models for changes. It was a lot of work to reorganize the code this way, but the app is now performing UI updates only when the relevant data changes, and most of the work is done in the background.
1w
Reply to Alternative for crashing API MPMediaItemArtwork
I ran into this myself and can confirm that marking the block @Sendable fixes the crash. I believe the problem is that the SDK doesn't require the block to be @Sendable, which it should. The MPNowPlayingInfoCenter is executing that block on an internal dispatch queue. If you call the constructor from an actor-isolated function, the block is also actor-isolated by default, and the now-playing center crashes trying to call the actor-isolated block.
1w
Reply to How to uninstall macOS Big Sur Beta from a separate APFS volume?
I don't have a full answer for you. I think at least some of the problems you are having are related to this item in the Big Sur release notes: If macOS Big Sur 11 beta is installed into the same APFS container as previous versions of macOS, system software updates can no longer be installed on the previous versions of macOS. (64411484) It seems that Big Sur is using an APFS volume format that is not recognized by Catalina. I would tread very carefully here, starting with good backups of your Catalina volume. Then, you might try booting into the recovery partition and seeing if it recognizes the Big Sur volumes properly. If it does you could try deleting them from there. Please understand, I have not tried this myself — it's just an idea.
Jun ’20