GKFadeNavigationController
This is an example implementation of a UINavigationController
with support of animated hiding and showing it's Navigation Bar.
Try it yourself
Online simulator on appetize.io
Features
- Animates tint color
- Takes care of the status bar color
- Similar pattern to
-preferredStatusbarStyle
- Uses native controls where possible (e.g. back button)
- Native looking translucent header
- Demo project with elastic header image
- iPhone X support
- Black navigation bar style support
Installation
GKFadeNavigationController is available through CocoaPods. To install
it, simply add the following line to your Podfile
:
pod "GKFadeNavigationController"
Then update your pods with pod install
.
Usage
- To run the example project, clone the repo, and run
pod install
from the Example directory first. - Set your Navigation Controller class to
GKFadeNavigationController
in Storyboard - Make your view controllers to conform
GKFadeNavigationControllerDelegate
protocol - Implement
-preferredNavigationBarVisibility
(returnGKFadeNavigationControllerNavigationBarVisibilityHidden
orGKFadeNavigationControllerNavigationBarVisibilityVisible
) - Send a
-setNeedsNavigationBarVisibilityUpdateAnimated:animated
message to the navigation controller when you want to hide or show the navigation bar
You can see the attached demo project for easier reference.
Requirements
- iOS 8 SDK
Works fine with iOS 11.
Known limitations
- Items under the header are not clickable
- Changing the status bar color happens in
-viewDidAppear
currently
Feel free to contribute or send me pull requests.
Changelog
Author
Gruber Kristóf, [email protected], @gklka
License
GKFadeNavigationController is available under the MIT license. See the LICENSE file for more info.