Skip to content

Routing with UITabBarController scenarioΒ #70

@dagio

Description

@dagio

UITabBarController allow to have multiple navigation stacks in each tabs. For example :

tabbar

On the previous image we can see tat we have 4 different stacks at the same time :

  • A / Y /
  • B / X /
  • C /
  • D /

The NavigationState design is :

public struct NavigationState {
    public init()
    public var route: Route
    public var routeSpecificState: [ReSwiftRouter.RouteHash : Any]
}

I'm struggling to find a way to use the current implementation while maintaining the native behaviour of the UITabBarController. The idea is to have the following scenario to work properly

Sequence NavigationState.route Next user action
1 / Tab on A in tab bar
2 / A Tap on Y in A
3 / A / Y Tab on B in tab bar
4 / B Tap on A in tab bar
5 / A / Y

Given the current implementation, NavigationState.route in the 5th sequence would be / A instead of / A / Y because the user action in the 4th sequence is destructive.

It seems that we should support non-linear navigation. Maybe more something like a route tree along with the current route in that tree.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions