|
I am having an issue with trying to figure out how to set the selected page on a TabView. As you can see from the code below, I have a view that will show all of my fetched results from CoreData. Inside my TabView I am iterating over each returned item and creating an HStack that contains an Image and a Title. This works great and I can swipe and view each connection, as well as when it is tapped, it selectes a connection. When it is selected the user is shown a view that allows them to Login to that connection, and when logged in, it will save the connections UUID stored in the Connection.ID field. The onAppear() below will get that UUID string and convert it back to a UUID and store that into my pageIndex. My pageIndex never changes when I swipe and change, as well as setting the selected to the last selected connection. What am I doing wrong?
|
|
I figured it out... and I hope it is the correct way to do it, but it works.
|
SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.