Well, it wasn't so hard after all! The question that remains is, how to most efficiently display a detail view on top of the view.
ToolbarItem(placement: ToolbarItemPlacement.navigation) {
Button(action: goBack) {
Label("Back", systemImage: "chevron.left")
}
}
}
Post
Replies
Boosts
Views
Activity
Thanks, done! FB7828239
I already use .sidebar. What I want to achieve is this https://img ur.com/a/wp6ssH5 like in Finder vs. https://img ur.com/a/pjdmSpP in my Catalyst app.
You can use the configuration options to do this. I did it myself like this to mirror the behavior of the Files app.
var configuration = UICollectionLayoutListConfiguration(appearance: .sidebar)
configuration.backgroundColor = .secondarySystemBackground
configuration.headerMode = .firstItemInSection
let layout = UICollectionViewCompositionalLayout.list(using: configuration)
collectionView = UICollectionView(frame: self.view.bounds, collectionViewLayout: layout)
...
An engineer answered this in the WWDC Slack. SwiftData does currently not support child contexts. A way around this would be to use a custom context, do the edits there and then apply them back to the mainContext and save it.
A context will save automatically periodically and on certain system events like didEnterBackground. If you want to save in the moment, you need to call context.save(). It might be possible that the autosave feature is buggy in Seed 1. The UI should update even if you don't manually save though.
Has anyone tried with the latest iOS 17.2 beta?
At first glance it's fixed as of iOS 17.2 beta 2, at least it does not crash any more with non-optional properties as it does on iOS 17.1 and below. I also don't see any attempts to sync in the console. So it seems like I can finally start bringing my app to SwiftData.
That's not possible as of now.
I have filed a feedback for this:
FB13840897
In my app I did adopt UISplitViewController to show a sidebar when the window is large enough or a tab bar in compact size classes. For that to work I had to do custom code to restore view hierarchies when switching size classes. Now, UITabBarController has this behavior for free, but I don’t want to adopt the new top tab bar in my app, because it breaks my layout and I just don’t like the look and feel of it. It would be great to have an option to hide the top tab bar, while keeping the sidebar visible and show the bottom tab bar when switching to compact size class.
Same issue here (FB13861460). A fresh project works just fine, so it appears to be something specific to how my project is set up. I can't read anything useful from the error log, though.
I have taken the time to write a blog post about all the issues I see with this new tab/sidebar design. If you're interested feel free to take a look and file similar feedback so we can have a better system in the Fall!
https://gamery.app/blog/about-the-new-tabs/
let customNavBarAppearance = UINavigationBarAppearance()
customNavBarAppearance.configureWithTransparentBackground()
Using a transparent navigation bar should do the trick.
For science I did a few more restores and I think I found the issue.
iPhone 16 ships with a pre-final special build of iOS 18. During setup I restored my iPhone 15 backup onto the device. After setup I was greeted with a new iOS 18.0 update, which brings it up to the final, public build. I think the pre-release build broke the stickers database.
When I tried to restore the iPhone 16 backup again (with the broken database) it obviously did not work.
So I tried restoring the iPhone 15 iCloud backup (where the stickers still worked) to the now final iOS 18.0 update. And guess what, everything's fine and dandy.
It appears the issue truly is that iOS 18.0 build the phone is shipping with. Why or how many people experience this issue, I don't know, but from what I gather from forums, it's quite a few.