UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Problem with Tabs under TabView "More..."

Forums > SwiftUI

In TabView, when it exceeds the width of device (for example, 5 on some phones), user can click on "More," to access rest of tabs.

However, for those tabs under More, it doesn't behave as well as those not in "More"

When "sheet" "popover" "alert" pop out from those tabs, dismissing the popout won't always go back to the correct one. It usually goes to the last Tab one used before. In other words, it doesn't come back to the right Tab.

Another question is that in iphone, one can use "Edit" to reorder the tabs, however, I didn't success to do so, the one outside of "More" switching back to original one within few seconds.

I have a workaround, is to passing @SceneStorage("selectedView") var selectedView: String?, and set to the "right" tab to back to before it gets dismissed.

However, it doesn't look so neat and feel more like hardcoded...

Anyone has met this before?

Thank you very much!

3      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.