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?
Post
Replies
Boosts
Views
Activity
Was anyone able to find a solution yet? Thank you
Were you able to find a solution to this? Thank you
Were you able to find a solution to this? Thank you
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()
}
}
}
}
Were you able to find a solution to this? Thank you