Slide transition for UINavigationController seen in Star Wars films
Put the file DHStarWarsTransition.swift
into your project.
Add a reference to an instance of NavigationControllerDelegate
to the class that creates the navigation controller (usually this is AppDelegate
). Create the instance and set the delegate of the navigation controller to that instance. In the demo app, this looks like this:
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? = UIWindow(frame: UIScreen.mainScreen().bounds)
let navigationControllerDelegate = NavigationControllerDelegate()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let firstViewController = FirstViewController()
let navigationController = UINavigationController(rootViewController: firstViewController)
navigationController.delegate = navigationControllerDelegate
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
return true
}
}
Add an Object to the scene with the navigation controller. Set the class of that object to NavigationControllerDelegate
. Connect the delegate property of the navigation controller with that object.
Dominik Hauser
MIT. See the Licence file for details