@@ -100,7 +100,12 @@ public protocol LinkNavigatorType {
100100 /// - paths: An array of ``RouteBuilder/matchPath`` for some specific pages.
101101 /// - items: A dictionary of `String` type key-value pairs.
102102 /// - isAnimated: makes the transition to be animated.
103- func fullSheet( paths: [ String ] , items: [ String : String ] , isAnimated: Bool )
103+ /// - prefersLargeTitles:
104+ /// The SubNavigationViewController has a Boolean value that determines whether to display the title in a large format.
105+ /// ``If the value is null or .none, the previously set value will be maintained.``
106+ /// You can set it to true to use a large title in the modal or control it dynamically.
107+ ///
108+ func fullSheet( paths: [ String ] , items: [ String : String ] , isAnimated: Bool , prefersLargeTitles: Bool ? )
104109
105110 /// Presents a custom sheet that has its own navigation stack.
106111 ///
@@ -112,7 +117,8 @@ public protocol LinkNavigatorType {
112117 /// items: [:],
113118 /// isAnimated: true,
114119 /// iPhonePresentationStyle: .fullScreen,
115- /// iPadPresentationStyle: .automatic)
120+ /// iPadPresentationStyle: .automatic,
121+ /// prefersLargeTitles: .none)
116122 /// ```
117123 ///
118124 /// - Note: If there's an active modal in `rootNavigationController`, then
@@ -123,12 +129,17 @@ public protocol LinkNavigatorType {
123129 /// - paths: An array of ``RouteBuilder/matchPath`` for some specific pages.
124130 /// - items: A dictionary of `String` type key-value pairs.
125131 /// - isAnimated: makes the transition to be animated.
132+ /// - prefersLargeTitles:
133+ /// The SubNavigationViewController has a Boolean value that determines whether to display the title in a large format.
134+ /// ``If the value is null or .none, the previously set value will be maintained.``
135+ /// You can set it to true to use a large title in the modal or control it dynamically.
126136 func customSheet(
127137 paths: [ String ] ,
128138 items: [ String : String ] ,
129139 isAnimated: Bool ,
130140 iPhonePresentationStyle: UIModalPresentationStyle ,
131- iPadPresentationStyle: UIModalPresentationStyle )
141+ iPadPresentationStyle: UIModalPresentationStyle ,
142+ prefersLargeTitles: Bool ? )
132143
133144 /// Replaces current navigation stack managed by `rootNavigationController` with the new one.
134145 ///
@@ -390,11 +401,13 @@ public enum NavigationTarget {
390401}
391402
392403extension LinkNavigator {
393- public func launch( paths: [ String ] , items: [ String : String ] ) -> RootNavigator {
404+
405+ public func launch( paths: [ String ] , items: [ String : String ] , prefersLargeTitles: Bool = false ) -> RootNavigator {
394406 let viewControllers = paths. compactMap { path in
395407 builders. first ( where: { $0. matchPath == path } ) ? . build ( self , items, dependency)
396408 }
397409 rootNavigationController. setViewControllers ( viewControllers, animated: false )
410+ rootNavigationController. navigationBar. prefersLargeTitles = prefersLargeTitles
398411
399412 return RootNavigator ( viewController: rootNavigationController)
400413 }
@@ -443,13 +456,18 @@ extension LinkNavigator: LinkNavigatorType {
443456 rootNavigationController. present ( subNavigationController, animated: isAnimated)
444457 }
445458
446- public func fullSheet( paths: [ String ] , items: [ String : String ] , isAnimated: Bool ) {
459+ public func fullSheet( paths: [ String ] , items: [ String : String ] , isAnimated: Bool , prefersLargeTitles : Bool ? ) {
447460 rootNavigationController. dismiss ( animated: true )
448461
449462 subNavigationController. modalPresentationStyle = . fullScreen
450463 let new = paths. compactMap { path in
451464 builders. first ( where: { $0. matchPath == path } ) ? . build ( self , items, dependency)
452465 }
466+
467+ if let prefersLargeTitles {
468+ subNavigationController. navigationBar. prefersLargeTitles = prefersLargeTitles
469+ }
470+
453471 subNavigationController. setViewControllers ( new, animated: false )
454472 rootNavigationController. present ( subNavigationController, animated: isAnimated)
455473 }
@@ -459,7 +477,8 @@ extension LinkNavigator: LinkNavigatorType {
459477 items: [ String : String ] ,
460478 isAnimated: Bool ,
461479 iPhonePresentationStyle: UIModalPresentationStyle ,
462- iPadPresentationStyle: UIModalPresentationStyle )
480+ iPadPresentationStyle: UIModalPresentationStyle ,
481+ prefersLargeTitles: Bool ? )
463482 {
464483 rootNavigationController. dismiss ( animated: true )
465484
@@ -470,6 +489,11 @@ extension LinkNavigator: LinkNavigatorType {
470489 let new = paths. compactMap { path in
471490 builders. first ( where: { $0. matchPath == path } ) ? . build ( self , items, dependency)
472491 }
492+
493+ if let prefersLargeTitles {
494+ subNavigationController. navigationBar. prefersLargeTitles = prefersLargeTitles
495+ }
496+
473497 subNavigationController. setViewControllers ( new, animated: false )
474498 rootNavigationController. present ( subNavigationController, animated: isAnimated)
475499 }
0 commit comments