Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 118 additions & 28 deletions Example/KGFloatingDrawer-Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions Example/KGFloatingDrawer-Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let kKGLeftDrawerStoryboardId = "KGLeftDrawerViewControllerStoryboardId"
let kKGRightDrawerStoryboardId = "KGRightDrawerViewControllerStoryboardId"


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window = UIWindow(frame: UIScreen.main.bounds)

window?.rootViewController = drawerViewController

Expand All @@ -33,25 +32,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down Expand Up @@ -84,38 +83,38 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

private func viewControllerForStoryboardId(storyboardId: String) -> UIViewController {
let viewController: UIViewController = drawerStoryboard().instantiateViewControllerWithIdentifier(storyboardId)
let viewController: UIViewController = drawerStoryboard().instantiateViewController(withIdentifier: storyboardId)
return viewController
}

func drawerSettingsViewController() -> UIViewController {
let viewController = viewControllerForStoryboardId(kKGDrawerSettingsViewControllerStoryboardId)
let viewController = viewControllerForStoryboardId(storyboardId: kKGDrawerSettingsViewControllerStoryboardId)
return viewController
}

func sourcePageViewController() -> UIViewController {
let viewController = viewControllerForStoryboardId(kKGDrawerWebViewViewControllerStoryboardId)
let viewController = viewControllerForStoryboardId(storyboardId: kKGDrawerWebViewViewControllerStoryboardId)
return viewController
}

private func leftViewController() -> UIViewController {
let viewController = viewControllerForStoryboardId(kKGLeftDrawerStoryboardId)
let viewController = viewControllerForStoryboardId(storyboardId: kKGLeftDrawerStoryboardId)
return viewController
}

private func rightViewController() -> UIViewController {
let viewController = viewControllerForStoryboardId(kKGRightDrawerStoryboardId)
let viewController = viewControllerForStoryboardId(storyboardId: kKGRightDrawerStoryboardId)
return viewController
}

func toggleLeftDrawer(sender:AnyObject, animated:Bool) {
_drawerViewController?.toggleDrawer(.Left, animated: true, complete: { (finished) -> Void in
_drawerViewController?.toggleDrawer(.left, animated: true, complete: { (finished) -> Void in
// do nothing
})
}

func toggleRightDrawer(sender:AnyObject, animated:Bool) {
_drawerViewController?.toggleDrawer(.Right, animated: true, complete: { (finished) -> Void in
_drawerViewController?.toggleDrawer(.right, animated: true, complete: { (finished) -> Void in
// do nothing
})
}
Expand Down
Loading