diff --git a/Source/Helpers/Extensions/UINavigationBar+Extensions.swift b/Source/Helpers/Extensions/UINavigationBar+Extensions.swift index 9d209e66b..5c8d08c5a 100644 --- a/Source/Helpers/Extensions/UINavigationBar+Extensions.swift +++ b/Source/Helpers/Extensions/UINavigationBar+Extensions.swift @@ -15,4 +15,20 @@ extension UINavigationBar { guard let font = font else { return } self.titleTextAttributes = [NSAttributedString.Key.font: font] } + + func configureNavigationBar(isTransculent: Bool, tintColor: UIColor) { + self.tintColor = tintColor + + if #available(iOS 15.0, *) { + let appearance = standardAppearance + if isTransculent { + appearance.configureWithTransparentBackground() + } else { + appearance.configureWithOpaqueBackground() + } + scrollEdgeAppearance = appearance + } else { + self.isTranslucent = isTransculent + } + } } diff --git a/Source/YPImagePicker.swift b/Source/YPImagePicker.swift index 9552775c6..3d3d7dbb2 100644 --- a/Source/YPImagePicker.swift +++ b/Source/YPImagePicker.swift @@ -37,7 +37,6 @@ open class YPImagePicker: UINavigationController { super.init(nibName: nil, bundle: nil) modalPresentationStyle = .fullScreen // Force .fullScreen as iOS 13 now shows modals as cards by default. picker.pickerVCDelegate = self - navigationBar.tintColor = .ypLabel } public required init?(coder aDecoder: NSCoder) { @@ -73,7 +72,7 @@ open class YPImagePicker: UINavigationController { } viewControllers = [picker] setupLoadingView() - navigationBar.isTranslucent = false + navigationBar.configureNavigationBar(isTransculent: false, tintColor: .ypLabel) picker.didSelectItems = { [weak self] items in // Use Fade transition instead of default push animation