- import UnlimitBar
- create custom navigation bar as UIView
- call applyNavigationBar method
- If you want animate navigationBar then use transitionAnimateion method
To run the example project, clone the repo, and run pod install
from the Example directory first.
- ScrollView case
// Create Custom UIView for NavigationBar
let catFeedNavBar = CatFeedNavigationBar.loadView()
// apply custom navigation bar
self.applyNavigationBar(catFeedNavBar, // custom navbar
expectHeight: CatFeedNavigationBar.Const.height, // navbar default height
backButton: nil, // back button auto hide
statusBarColor: UIColor.white, // status bar color
relatedScrollView: tableView) // tableView -> autoresize content top inset
transition animation
func scrollViewDidScroll(_ scrollView: UIScrollView) {
self.transitionAnimateion(scrollView, type: .autohide) // auto show/hide
// if you want control show/hide navbar base scroll offset
self.transitionAnimateion(scrollView, type: .transition(SHOW_OFFSET, HIDE_OFFSET))
self.transitionAnimateion(scrollView, type: .reset) // reset animation
}
- Single ViewController
- first you need uppermost top constraint of view on view controller
@IBOutlet weak var topConstraint: NSLayoutConstraint!
or
let topConstraint: NSLayoutConstraint ...
- insert constraint parameter on applyNavigationBar method
let catNavigationBar = CatSingleNavigationBar.loadView()
self.applyNavigationBar(catNavigationBar, // custom bar
expectHeight: CatSingleNavigationBar.Const.navBarHeight, // bar height
backButton: catNavigationBar.backButton, // back button
statusBarColor: UIColor.white, // color
subViewTopConstraint: self.topConstraint) // CONSTRAINT
- Fix some method name spelling
- Scroll offset base navigationBar animation
- Support TabBar
- Update constraint after rotate orientation
UnlimitBar is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'UnlimitBar'
Geektree0101, h2s1880@gmail.com
UnlimitBar is available under the MIT license. See the LICENSE file for more info.