I'm having a similar issue. My TabView used to work on all platforms and it still does on iOS and iPadOS.
However on macCatalyst clicking any tab will revert to the first tab on the TabView after a short while. The selection value will not be updated when clicking on a new tab.
Setting the value programmatically works fine.
The issue still persists when building with Xcode 16.1 beta 3.
//storing selected tab in view struct
enum UITab {
case clip
case charts
}
@State private var selectedUITab: UITab = .clip
...
//the actual TabView in the view's body
TabView(selection: self.$selectedUITab) {
Tab("First Tab", image: "tab1", value: .clip) {
FirstView()
}
Tab("Second Tab", image: "tab2", value: .charts) {
SecondView()
}
//...etc
}
Post
Replies
Boosts
Views
Activity
Update: Messages and Spotlight are useless again. So this is not even a one time problem, it is recurring.
Just to let you guys know, after I've had this problem for a few days now Messages and Spotlight just started working again.
I do not know how to reproduce this or whether it will come back, the problem came out of the blue and just vanished again.
The best solution so far seems to me to just keep the machine running through the night and hope it will be done with whatever task that causes the problems by the next morning..
I'll mark this as the correct answer as long as there is no definitive solution on how to fix it (except downgrading to Catalina).
Same problem.
I do not believe this is Apple's intended solution but Suni201114's workaround did the trick, thanks!
Edit: You can just toggle the previous version by unchecking it.,saving, hit refresh, then reactivate it and you're good to go.
Encapsulatin in a VStack did the trick. Thank you!Looks like a bug to me, since the VStack does not make any sense within the structure of the UI here. Thanks for filing a bug report!
I have added the relevant part of the surrounding class for completeness, thank you.