Same here!
Post
Replies
Boosts
Views
Activity
Is there a workaround?
I need to do something to be able to release the app to AppStore (iOS app got approved, but macOS is rejected). I don't know the review process, but maybe they run it couple of times and every time is a "cold" start. Any suggestions?
@effenix Have you able to resolve your issue? Having the same one, here is the example:
struct ContentView: View {
@Query(sort: \File.name) private var files: [File]
var body: some View {
NavigationStack {
FilesView(files: files) // <- Just wrapped the code into a separate view
}
}
}
struct FilesView: View {
var files: [File]
var body: some View {
ForEach(files) { file in
NavigationLink(value: file) {
FileTileView(file: file) // <- Another extracted view
}
}
}
}
struct FileTileView: View {
var file: File
var body: some View {
Text(file.name) // <- Doesn't get updated when CloudKit received the sync update
}
}
It does work without the wrappers:
@Model
final class File {
var name: String = "" // <- I edit the name on another device in the simple text editor, the editor code is ommited as it's not significant
init(name: String) {
self.name = name
}
}
struct ContentView: View {
@Query(sort: \File.name) private var files: [File]
var body: some View {
NavigationStack {
ForEach(files) { file in
NavigationLink(value: file) {
Text(file.name) // <- The text updates successfully after CloudKit sync
}
}
}
}
}
On iOS 17.4 placing the .toolbar(.visible, for: .bottomBar) on the view which has the toolbar with the toolbar items placed as .bottomBar solved this issue where back swipe brakes navigation and also the issue with toolbar dissapearing after swipe back.
Here is pseudocode of my views with which I had both the broken navigation and dissapearing bottom toolbar issues:
NavigationSplitView {
SidebarView
.toolbar(.visible, for: .bottomBar) // <- solves all issues
.toolbar { // with this toolbar I had broken navigation as described in the original question
ToolbarItem(placement: .bottomBar) { ... }
}
} detail: {
DetailView
.toolbar { // with this one I had an issue with this toolbar as so as the sidebar's toolbar dissapearing after trying to swipe left
ToolbarItem(placement: .bottomBar) { ... }
}
}