Post

Replies

Boosts

Views

Activity

Reply to `NavigationSplitView` with `ZStack` in detail view causes `.sheet(item` to hang
Thank you @DTS Engineer . Here is an example from the WWDC session "What's new with SwiftUI". It isn't a great experience, because when the user switches between menu items state of the detail view is recreated. Scroll position, textfield values, and @State in FoodOverview() or MusicOverview() are lost. This challenge is in all SwiftUI versions, not just MacOS 13.6. The workaround I use is to wrap the detail view in a ZStack. The problem on MacOS 13.6 is using ZStack makes .sheet buggy. I haven't tried the beta - I need to solve on 13.6. @State var selectedTask: PartyTask? var body: some View { NavigationSplitView { List(PartyTask.allCases, selection: $selectedTask) { NavigationLink(value: $0) { TaskLabel(task: $0) } } } detail: { switch selectedTask { case .food: FoodOverview() case .music: MusicOverview() } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’24
Reply to [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. What does this mean?
Were you able to find a solution to this? Thank you
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to `NavigationSplitView` with `ZStack` in detail view causes `.sheet(item` to hang
Thank you @DTS Engineer . Here is an example from the WWDC session "What's new with SwiftUI". It isn't a great experience, because when the user switches between menu items state of the detail view is recreated. Scroll position, textfield values, and @State in FoodOverview() or MusicOverview() are lost. This challenge is in all SwiftUI versions, not just MacOS 13.6. The workaround I use is to wrap the detail view in a ZStack. The problem on MacOS 13.6 is using ZStack makes .sheet buggy. I haven't tried the beta - I need to solve on 13.6. @State var selectedTask: PartyTask? var body: some View { NavigationSplitView { List(PartyTask.allCases, selection: $selectedTask) { NavigationLink(value: $0) { TaskLabel(task: $0) } } } detail: { switch selectedTask { case .food: FoodOverview() case .music: MusicOverview() } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’24
Reply to Having issues with .sheet and .dismiss()
Were you able to find a solution to this? Thank you
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to iOS 17 SwiftUI sheet immediately dismisses after opening
Were you able to find a solution to this? Thank you
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Infinite loop getting "_dismiss changed"
Was anyone able to find a solution yet? Thank you
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Why did self change?
what i meant to ask is what are the methods of determining what caused @self to change, or what are the types of events that can cause self to change?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’24