File tree Expand file tree Collapse file tree
Sources/LinkNavigator/Core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,10 +5,17 @@ public struct TabItem {
55 public let tag : Int
66 public let tabItem : UITabBarItem ?
77 public let linkItem : LinkItem
8+ public let prefersLargeTitles : Bool
89
9- public init ( tag: Int , tabItem: UITabBarItem ? , linkItem: LinkItem ) {
10+ public init (
11+ tag: Int ,
12+ tabItem: UITabBarItem ? ,
13+ linkItem: LinkItem ,
14+ prefersLargeTitles: Bool = false )
15+ {
1016 self . tag = tag
1117 self . tabItem = tabItem
1218 self . linkItem = linkItem
19+ self . prefersLargeTitles = prefersLargeTitles
1320 }
1421}
Original file line number Diff line number Diff line change @@ -68,20 +68,21 @@ extension TabLinkNavigator {
6868extension TabLinkNavigator {
6969 public func launch( tagItemList: [ TabItem ] ) -> [ UINavigationController ] {
7070 let tabPartialNavigators = tagItemList
71- . reduce ( [ TabPartialNavigator] ( ) ) { curr, next in
71+ . reduce ( [ ( Bool , TabPartialNavigator) ] ( ) ) { curr, next in
7272 let newNavigatorList = TabPartialNavigator (
7373 rootNavigator: self ,
7474 tabItem: next,
7575 routeBuilderItemList: routeBuilderItemList,
7676 dependency: dependency)
77- return curr + [ newNavigatorList]
77+ return curr + [ ( next . prefersLargeTitles , newNavigatorList) ]
7878 }
7979
8080 tabRootNavigators = tabPartialNavigators
81- . map { navigator in
81+ . map { ( prefersLargeTitles , navigator) in
8282 let partialNavigationVC = navigator. launch ( rootPath: navigator. tabItem. linkItem. pathList. first ?? " " )
8383 let item = tagItemList. first ( where: { $0. linkItem == navigator. tabItem. linkItem } )
8484 partialNavigationVC. navigationController. tabBarItem = item? . tabItem
85+ partialNavigationVC. navigationController. navigationBar. prefersLargeTitles = prefersLargeTitles
8586 return partialNavigationVC
8687 }
8788
You can’t perform that action at this time.
0 commit comments