Post

Replies

Boosts

Views

Activity

Reply to SwiftUI view not updated after SwiftData change through CloudKit
@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 } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24
Reply to SwiftUI BottomBar Toolbar on parent view breaks leading navigation swipe on iOS 17.0
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) { ... } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24
Reply to UIViewRepresentable animations
Same here!
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to SwiftData: Unable to find a configuration named 'default' in the specified managed object model
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?
Replies
Boosts
Views
Activity
Aug ’24
Reply to SwiftUI view not updated after SwiftData change through CloudKit
@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 } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to SwiftUI BottomBar Toolbar on parent view breaks leading navigation swipe on iOS 17.0
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) { ... } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’24