Skip to content
Snippets Groups Projects
NavigationBar.swift 649 B
Newer Older
Bruno Muniz's avatar
Bruno Muniz committed
import UIKit

public extension UINavigationBar {
    func customize(
        translucent: Bool = false,
        backgroundColor: UIColor = .clear,
Bruno Muniz's avatar
Bruno Muniz committed
        shadowColor: UIColor? = nil,
        tint: UIColor = Asset.neutralActive.color
Bruno Muniz's avatar
Bruno Muniz committed
    ) {
        isTranslucent = translucent
        let barAppearance = UINavigationBarAppearance()
        barAppearance.backgroundColor = backgroundColor
        barAppearance.backgroundEffect = .none
        barAppearance.shadowColor = shadowColor
Bruno Muniz's avatar
Bruno Muniz committed

        tintColor = tint
        compactAppearance = barAppearance
Bruno Muniz's avatar
Bruno Muniz committed
        standardAppearance = barAppearance
Bruno Muniz's avatar
Bruno Muniz committed
        scrollEdgeAppearance = barAppearance
Bruno Muniz's avatar
Bruno Muniz committed
    }
}