Latest 1.3.0
Homepage https://github.com/geroembser/AdvancedNavigationController
License MIT
Platforms ios 12.0

Installation

Preferred installation is using CocoaPods.

To Integrate the AdvancedNavigationController into your project using CocoaPods, specify it in your Podfile:

pod 'AdvancedNavigationController'

Usage

For an example, see the sample project 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…
example app animated gif

License

This project is licensed under the MIT License – see the LICENSE file for details

Latest podspec

{
    "name": "AdvancedNavigationController",
    "version": "1.3.0",
    "authors": "Gero Embser",
    "homepage": "https://github.com/geroembser/AdvancedNavigationController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "An advanced UINavigationController with very few advanced features...",
    "source": {
        "git": "https://github.com/geroembser/AdvancedNavigationController.git",
        "tag": "1.3.0"
    },
    "platforms": {
        "ios": "12.0"
    },
    "swift_version": "4.2",
    "source_files": "Source/*.swift"
}

Pin It on Pinterest

Share This