Skip to content

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

Notifications You must be signed in to change notification settings

soyzamudio/SwiftAppMenuController

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages