@@ -594,55 +594,35 @@ + (void)updateViewController:(UIViewController *)vc
594
594
}
595
595
#endif
596
596
597
- // TODO: This needs to be removed after min. tvOS deployment target bump
598
- #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
599
- __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
600
- if (@available (iOS 13.0 , tvOS 13.0 , *)) {
601
- UINavigationBarAppearance *appearance = [self buildAppearance: vc withConfig: config];
602
- navitem.standardAppearance = appearance;
603
- navitem.compactAppearance = appearance;
597
+ UINavigationBarAppearance *appearance = [self buildAppearance: vc withConfig: config];
598
+ navitem.standardAppearance = appearance;
599
+ navitem.compactAppearance = appearance;
604
600
605
601
// appearance does not apply to the tvOS so we need to use lagacy customization
606
602
#if TARGET_OS_TV
607
- navctr.navigationBar .titleTextAttributes = appearance.titleTextAttributes ;
608
- navctr.navigationBar .backgroundColor = appearance.backgroundColor ;
603
+ navctr.navigationBar .titleTextAttributes = appearance.titleTextAttributes ;
604
+ navctr.navigationBar .backgroundColor = appearance.backgroundColor ;
609
605
#endif
610
606
611
- UINavigationBarAppearance *scrollEdgeAppearance =
612
- [[UINavigationBarAppearance alloc ] initWithBarAppearance: appearance];
613
- if (config.largeTitleBackgroundColor != nil ) {
614
- // Add support for using a fully transparent bar when the backgroundColor is set to transparent.
615
- if (CGColorGetAlpha (config.largeTitleBackgroundColor .CGColor ) == 0 .) {
616
- // This will also remove the background blur effect in the large title which is otherwise inherited from the
617
- // standard appearance.
618
- [scrollEdgeAppearance configureWithTransparentBackground ];
619
- // This must be set to nil otherwise a default view will be added to the navigation bar background with an
620
- // opaque background.
621
- scrollEdgeAppearance.backgroundColor = nil ;
622
- } else {
623
- scrollEdgeAppearance.backgroundColor = config.largeTitleBackgroundColor ;
624
- }
625
- }
626
- if (config.largeTitleHideShadow ) {
627
- scrollEdgeAppearance.shadowColor = nil ;
628
- }
629
- navitem.scrollEdgeAppearance = scrollEdgeAppearance;
630
- } else
631
- #endif // Check for iOS / tvOS 13
632
- {
633
- #if !TARGET_OS_TV
634
- // updating backIndicatotImage does not work when called during transition. On iOS pre 13 we need
635
- // to update it before the navigation starts.
636
- UIImage *backButtonImage = [config loadBackButtonImageInViewController: vc];
637
- if (backButtonImage) {
638
- navctr.navigationBar .backIndicatorImage = backButtonImage;
639
- navctr.navigationBar .backIndicatorTransitionMaskImage = backButtonImage;
640
- } else if (navctr.navigationBar .backIndicatorImage ) {
641
- navctr.navigationBar .backIndicatorImage = nil ;
642
- navctr.navigationBar .backIndicatorTransitionMaskImage = nil ;
607
+ UINavigationBarAppearance *scrollEdgeAppearance =
608
+ [[UINavigationBarAppearance alloc ] initWithBarAppearance: appearance];
609
+ if (config.largeTitleBackgroundColor != nil ) {
610
+ // Add support for using a fully transparent bar when the backgroundColor is set to transparent.
611
+ if (CGColorGetAlpha (config.largeTitleBackgroundColor .CGColor ) == 0 .) {
612
+ // This will also remove the background blur effect in the large title which is otherwise inherited from the
613
+ // standard appearance.
614
+ [scrollEdgeAppearance configureWithTransparentBackground ];
615
+ // This must be set to nil otherwise a default view will be added to the navigation bar background with an
616
+ // opaque background.
617
+ scrollEdgeAppearance.backgroundColor = nil ;
618
+ } else {
619
+ scrollEdgeAppearance.backgroundColor = config.largeTitleBackgroundColor ;
643
620
}
644
- #endif
645
621
}
622
+ if (config.largeTitleHideShadow ) {
623
+ scrollEdgeAppearance.shadowColor = nil ;
624
+ }
625
+ navitem.scrollEdgeAppearance = scrollEdgeAppearance;
646
626
#if !TARGET_OS_TV
647
627
navitem.hidesBackButton = config.hideBackButton ;
648
628
#endif
0 commit comments