/SwiftAppMenuController

Facebook's Paper.app like menu adapted to Swift from GTAppMenuController from Gianluca Tursi

Primary LanguageSwift

SwiftAppMenuController

demo

Importing

import SwiftAppMenuController.swift to your project

How To Use

In your AppDelegate.swift add:

var window: UIWindow?
var backWindow: UIWindow?

  func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
        
    var str:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    var _back:BackViewController = str.instantiateViewControllerWithIdentifier("back") as BackViewController
        
    self.backWindow = UIWindow(frame: UIScreen.mainScreen().bounds)
    self.backWindow!.rootViewController = _back
    backWindow?.makeKeyAndVisible()
        
    var _front:SwiftAppMenuController = str.instantiateViewControllerWithIdentifier("front") as SwiftAppMenuController
        
    self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
    self.window!.rootViewController = _front
    self.window!.makeKeyAndVisible()
        
    return true
  }

In your FrontViewController.swift declare the following property:

var navController = SwiftAppMenuController()

and add the following to your viewDidLoad()

navController = self.navigationController as SwiftAppMenuController
navController.setNavigationBarHidden(false, animated: false)

and add the following function:

func menuPressed() -> Void {
  navController.openAndCloseMenu()
}

Please make sure you check how the Main.storyboard is set up in the Demo app.

Contact

Jose Zamudio

Credits

Gianluca Tursi for GTAppMenuController