https://github.com/geektree0101/unlimitbar
I HATE UINavigationBar attribute restriction
https://github.com/geektree0101/unlimitbar
ios swift uikit
Last synced: 6 days ago
JSON representation
I HATE UINavigationBar attribute restriction
- Host: GitHub
- URL: https://github.com/geektree0101/unlimitbar
- Owner: GeekTree0101
- License: mit
- Created: 2017-11-04T09:52:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-05T15:48:20.000Z (over 8 years ago)
- Last Synced: 2024-09-18T01:39:22.803Z (almost 2 years ago)
- Topics: ios, swift, uikit
- Language: Swift
- Size: 3.11 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UnlimitBar
[](https://travis-ci.org/Geektree0101/UnlimitBar)
[](http://cocoapods.org/pods/UnlimitBar)
[](http://cocoapods.org/pods/UnlimitBar)
[](http://cocoapods.org/pods/UnlimitBar)

### Feel the freedom from UINavigationBar ~~Holy Shit~~ Restrictions
## [Guideline]
1. import UnlimitBar
2. create custom navigation bar as UIView
3. call applyNavigationBar method
+ If you want animate navigationBar then use transitionAnimateion method
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
1. ScrollView case
```swift
// 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
```swift
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
}
```
2. Single ViewController
- first you need uppermost top constraint of view on view controller
```swift
@IBOutlet weak var topConstraint: NSLayoutConstraint!
or
let topConstraint: NSLayoutConstraint ...
```
- insert constraint parameter on applyNavigationBar method
```swift
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
```
## TODO(milestone)
- Fix some method name spelling
- Scroll offset base navigationBar animation
- Support TabBar
- Update constraint after rotate orientation
## Installation
UnlimitBar is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'UnlimitBar'
```
## Author
Geektree0101, h2s1880@gmail.com
## License
UnlimitBar is available under the MIT license. See the LICENSE file for more info.