Post

Replies

Boosts

Views

Activity

Reply to Fixed SwiftUI window sizes in macOS with Xcode 14 and Ventura for macOS 11/12 targets
You can make the .windowResizability(.contentSize) scene modifier conditional like so: extension Scene {     func windowResizabilityContentSize() -> some Scene {         if #available(macOS 13.0, *) {             return windowResizability(.contentSize)         } else {             return self         }     } } And then use it on WindowGroup this way: WindowGroup { ... } .windowResizabilityContentSize()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to SwiftUI Navigation Stack pops back on ObservableObject update
Changing the NavigationView's style to .stack seems to do the trick for me. This has solved other navigation-related problems in the past for me as well. You need to apply the modifier directly to the NavigationView, not to its contents: NavigationView { ShoppingListsView() }.navigationViewStyle(.stack)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Fixed SwiftUI window sizes in macOS with Xcode 14 and Ventura for macOS 11/12 targets
You can make the .windowResizability(.contentSize) scene modifier conditional like so: extension Scene {     func windowResizabilityContentSize() -> some Scene {         if #available(macOS 13.0, *) {             return windowResizability(.contentSize)         } else {             return self         }     } } And then use it on WindowGroup this way: WindowGroup { ... } .windowResizabilityContentSize()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22