https://github.com/geroembser/advancednavigationcontroller
A not yet far advanced UINavigationController subclass with additional features that may help in some situations.
https://github.com/geroembser/advancednavigationcontroller
ios12 swift swift4-2 uinavigationcontroller
Last synced: 5 months ago
JSON representation
A not yet far advanced UINavigationController subclass with additional features that may help in some situations.
- Host: GitHub
- URL: https://github.com/geroembser/advancednavigationcontroller
- Owner: geroembser
- License: mit
- Created: 2018-08-22T20:28:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-23T19:32:24.000Z (over 2 years ago)
- Last Synced: 2025-10-10T04:33:42.694Z (6 months ago)
- Topics: ios12, swift, swift4-2, uinavigationcontroller
- Language: Swift
- Size: 636 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AdvancedNavigationController
## Installation
Preferred installation is using [CocoaPods](https://cocoapods.org).
To Integrate the `AdvancedNavigationController` into your project using CocoaPods, specify it in your `Podfile`:
```
pod 'AdvancedNavigationController'
```
## Usage
For an example, see the [sample project](Example) included in this repo.
```
//Create instance and use it
let nc = AdvancedNavigationController()
let willShowEventHandler = nc.add(willShowEventAction: { (showingViewController) in
//do something with the ViewController that is about to go on screen (but not yet finally visible until didShow occurred)
})
let didShowEventHandler = nc.add(didShowEventAction: { (showedViewController) in
//do something with the ViewController that was shown (i. e. now visible on screen)
})
let willPopEventHandler = nc.add(willPopEventAction: { (poppingViewController) in
//do something with the ViewController that is about to popped from screen
//Note: it is possible that popping is interrupted (e.g. by interactive swipe back)
})
let didPopEventHandler = nc.add(didPopEventAction: { (poppedViewController) in
//do something with the ViewController that was popped from screen
})
//Note: we use `_` (underscore) here to discard the result, because for the whole lifetime of the `nc` instance, we're interested in doing a specific action when pushing occurs
_ = nc.add(willPushEventAction: { (pushingViewController) in
//do something with the ViewController that is about to be pushed on screen
})
_ = nc.add(didPushEventAction: { (pushedViewController) in
//do something with the ViewController that was pushed on screen
})
//after a specific event, we can remove the added event handlers, to no longer perform the specified actions
nc.remove(eventHandlers:[willShowEventHandler, willPopEventHandler])
```
## Example
This is the example app...

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details