turbolinks / turbolinks-ios

Native iOS adapter for building hybrid apps with Turbolinks 5
MIT License
880 stars 92 forks source link

topmostVisitable on Session when using UITabBar #148

Closed gearoidoceallaigh closed 5 years ago

gearoidoceallaigh commented 5 years ago

The topmostVisitable accessor on Session is really useful for getting the most recent view controller. However, its behaviour then using a UITabBar is a little confusing.

What I would expect to happen:

When I call topmostVisitable then I get the top most view controller on the stack for the selected tab on the UITabBar.

What actually happens:

topmostVisitable returns the top most view controller on the navigation stack which was most recently interacted with.

zachwaugh commented 5 years ago

Are you using a single Session with multiple UINavigationController each in their own tab? I don't think there is any way around this if you're using a single Session, as it has no awareness of the navigation structure or view controllers of your app. For Basecamp, we have multiple Session, each responsible for a single navigation stack.