https://github.com/urlaunched-com/mfnavigationbarappearing
Navigation bar interactive appearing
https://github.com/urlaunched-com/mfnavigationbarappearing
animation ios navigation-controller swift urlaunched
Last synced: 11 months ago
JSON representation
Navigation bar interactive appearing
- Host: GitHub
- URL: https://github.com/urlaunched-com/mfnavigationbarappearing
- Owner: urlaunched-com
- Created: 2018-10-31T16:22:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T13:55:20.000Z (almost 4 years ago)
- Last Synced: 2025-04-22T12:43:53.812Z (about 1 year ago)
- Topics: animation, ios, navigation-controller, swift, urlaunched
- Language: Swift
- Homepage: https://urlaunched.com/
- Size: 8.32 MB
- Stars: 29
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MFNavigationBarAppearing
[](http://urlaunched.com/)






"the app is developed by [You are launched](https://www.urlaunched.com)"
## Requirements
* Xcode 10+
* iOS 9.0+
* Swift 4.2
## Example
Open and run the **MFNavigationBarAppearing.xcodeproj** in Xcode to see example
## Installation
### CocoaPods
``` ruby
source "https://github.com/Molfar-io/MFPodSpecs.git"
pod 'MFNavigationBarAppearing'
```
### Manual
Add MFNavigationBarAppearing/**Code** folder into your project.
## Usage
First of all you need to setup **content insets** of your scroll view

### Important
You need to use **`MFNavigationBarAppearingController`** instead of UINavigationContoller for presenting your UIViewController. This UIViewController should implement **`MFNavigationBarAppearer`** protocol
```swift
let navigationController = MFNavigationBarAppearingController(rootViewController: UIViewController())
present(navigationController, animated: true, completion: nil)
```
Next step is implement **`MFNavigationBarAppearer`** protocol in your **`UIViewController`**:
```swift
import MFNavigationBarAppearing
//MARK: - MFNavigationBarAppearer
extension UIViewController: MFNavigationBarAppearer {
var appearingScrollView: UIScrollView? {
return scrollView
}
var navigationBarStartAppearingOffset: CGFloat {
return collectionViewContainer.frame.height - collectionViewBottomSpacing
}
var navigationBarEndAppearingOffset: CGFloat? {
return collectionViewContainer.frame.height
}
var appearingTitle: String? {
return place.title?.uppercased()
}
var appearingTitleStartOffsetAfterAppearingNavBar: CGFloat? {
return collectionViewContainer.frame.height + titleLabelTopSpacing
}
var appearingTitleEndOffsetAfterAppearingNavBar: CGFloat? {
return collectionViewContainer.frame.height + placeTitleLabel.frame.height
}
}
```
#### appearingScrollView
It's **UIScrollView** which we will use to handle content offset for calculating appearing state of the navigation bar.
#### navigationBarStartAppearingOffset
The offset from the top of the screen, when you need to start navigation bar appearing.
#### navigationBarEndAppearingOffset (Optional)
The offset when navigation bar appearing should end. If the value is not provided, it will be calculated depending on the height of the navigation bar.
#### appearingTitle (Optional)
The title that will be appearing interactively.
#### appearingTitleStartOffsetAfterAppearingNavBar (Optional)
The offset (delay in pixels) befor starting title appearing. 0 by default.
#### appearingTitleEndOffsetAfterAppearingNavBar (Optional)
The offset when navigation bar appearing should be finish. By default title will be appeared together with navigation bar.
## Contacts
If you have any questions regarding pod usage or any improvements ideas, just contact me by email mx.kuznetsov.dev@gmail.com
P.S. If you have ideas for this pod, but don't have time to implement it - write us your idea and we will do it.
## Our resources
[Official website](https://www.urlaunched.com)
[Our company timeline](https://www.urlaunched.com/timeline)
[You are launched expertise](https://www.urlaunched.com/expertise)
[You are launched iOS expertise](https://www.urlaunched.com/expertise/mvp/ios)
[You are launched Android expertise](https://www.urlaunched.com/expertise/mvp/android)
[You are launched design expertise](https://www.urlaunched.com/expertise/design)
[You are launched web expertise](https://www.urlaunched.com/expertise/web)
[You are launched Lean Startup expertise](https://www.urlaunched.com/expertise/idea)
[You are launched successful startups](https://www.urlaunched.com/launched)
[Official blog](https://blog.urlaunched.com/)
## License
The MIT License (MIT)
Copyright © 2018 Max Kuznetsov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.