Latest 1.0.0
Homepage https://github.com/EMart86/EMTransformableNavigationController
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Screenshot

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

EMTransformableNavigationController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'EMTransformableNavigationController'

Author

Martin Eberl [email protected]

License

EMTransformableNavigationController is available under the MIT license. See the LICENSE file for more info.

Example

Simply add the NavigationController to your view controller

override func viewDidLoad() {
    super.viewDidLoad()

    createAndAddTransformableViewController()
}

private func createAndAddTransformableViewController() {
    let viewController = UIViewController() //use any viewController
    viewController.view.backgroundColor = .lightGray
    let navigationController = EMTransformableNavigationController(rootViewController: viewController)
    navigationController.add(to: self)
}

A more convenient way to add a viewController is with the motion shake gesture

override func motionEnded(_ motion: UIEventSubtype, with event: UIEvent?) {
    if motion == .motionShake {
        createTransformableNavigationController()
    }
}

To remove the viewController, simply call

    transformableNavigationController.removeFromParentViewController() 
    //of course the navigationController needed to be stored in a proterty which we called transformableNavigationController

If you don’t want the user to move out of the visible frame, simply set following property (defaulf is nil, which allowes the user to drag the navigation controller out of the bounds)

transformableNavigationController.allowedFrame = view.bounds

If you think, the user should be allowed to only shrink your view to a specific size, simply set following property (default is 100×100 px)

transformableNavigationController.minViewSize = CGSize(width: 300, height: 150)

If you were wondering if all this works with autolayout; it does, i just tested it :)

Latest podspec

{
    "name": "EMTransformableNavigationController",
    "version": "1.0.0",
    "summary": "A UINavigationController with Pan and Pinch Gesture Recognition",
    "description": "This derived UINavigationController with Pinch and Pan Gesture Recognition is designed to be dragged and pinched along on the window. Since you can pinch these navigation controllers, your client can add many small draggable windows and thus let the user design his/her own control window.",
    "homepage": "https://github.com/EMart86/EMTransformableNavigationController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Martin Eberl": "[email protected]"
    },
    "source": {
        "git": "https://github.com/EMart86/EMTransformableNavigationController.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "EMTransformableNavigationController/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This