Change NavigationBar's transparency at pop gestrue and other situation
Add the following line to your Podfile:
pod 'ETNavBarTransparent'Then, run the following command:
$ pod installOr, simply drag ETNavBarTransparent.swift to your project.
Change NavigationBar's transparency and tintColor where you want:
// Example:
// Change in viewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
self.navBarBgAlpha = 0
self.navBarTintColor = .white
}
// Change in scrollView scroll
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.contentOffset.y > 100 {
navBarBgAlpha = 1
navBarTintColor = UIColor.defaultNavBarTintColor()
} else {
navBarBgAlpha = 0
navBarTintColor = .white
}
}MIT license. See LICENSE for details.
