Commit 8b1fc4de by Daniel Dahan

updated SideNavigationController to NavigationDrawerController

parent e2ec3173
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
location = "group:Programmatic/BottomNavigationController/BottomNavigationController.xcodeproj"> location = "group:Programmatic/BottomNavigationController/BottomNavigationController.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:Programmatic/SideNavigationController/SideNavigationController.xcodeproj"> location = "group:Programmatic/NavigationDrawerController/NavigationDrawerController.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:Programmatic/CardView/CardView.xcodeproj"> location = "group:Programmatic/CardView/CardView.xcodeproj">
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
location = "group:Storyboards/BottomTabBar/BottomTabBar.xcodeproj"> location = "group:Storyboards/BottomTabBar/BottomTabBar.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:Storyboards/SideNavigationController/SideNavigationController.xcodeproj"> location = "group:Storyboards/NavigationDrawerController/NavigationDrawerController.xcodeproj">
</FileRef> </FileRef>
</Group> </Group>
</Workspace> </Workspace>
...@@ -58,7 +58,7 @@ class AppBottomNavigationController: BottomNavigationController { ...@@ -58,7 +58,7 @@ class AppBottomNavigationController: BottomNavigationController {
/// Handles the menuButton. /// Handles the menuButton.
internal func handleMenuButton() { internal func handleMenuButton() {
sideNavigationController?.openLeftView() navigationDrawerController?.openLeftView()
} }
/// Handles the searchButton. /// Handles the searchButton.
......
...@@ -40,11 +40,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -40,11 +40,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let bottomNavigationController: AppBottomNavigationController = AppBottomNavigationController() let bottomNavigationController: AppBottomNavigationController = AppBottomNavigationController()
let navigationController: AppNavigationController = AppNavigationController(rootViewController: bottomNavigationController) let navigationController: AppNavigationController = AppNavigationController(rootViewController: bottomNavigationController)
let sideNavigationController: SideNavigationController = SideNavigationController(rootViewController: navigationController, leftViewController: AppLeftViewController()) let navigationDrawerController: NavigationDrawerController = NavigationDrawerController(rootViewController: navigationController, leftViewController: AppLeftViewController())
sideNavigationController.statusBarStyle = .LightContent navigationDrawerController.statusBarStyle = .LightContent
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = sideNavigationController window!.rootViewController = navigationDrawerController
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
/* /*
The following is an example of setting a UITableView as the LeftViewController The following is an example of setting a UITableView as the LeftViewController
within a SideNavigationController. within a NavigationDrawerController.
*/ */
import UIKit import UIKit
......
...@@ -64,13 +64,13 @@ class AppMenuController: MenuController { ...@@ -64,13 +64,13 @@ class AppMenuController: MenuController {
override func openMenu(completion: (() -> Void)? = nil) { override func openMenu(completion: (() -> Void)? = nil) {
super.openMenu(completion) super.openMenu(completion)
sideNavigationController?.enabled = false navigationDrawerController?.enabled = false
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 45)) (menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 45))
} }
override func closeMenu(completion: (() -> Void)? = nil) { override func closeMenu(completion: (() -> Void)? = nil) {
super.closeMenu(completion) super.closeMenu(completion)
sideNavigationController?.enabled = true navigationDrawerController?.enabled = true
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 0)) (menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 0))
} }
......
...@@ -46,7 +46,7 @@ class AppSearchBarController: SearchBarController { ...@@ -46,7 +46,7 @@ class AppSearchBarController: SearchBarController {
override func viewWillAppear(animated: Bool) { override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
statusBarStyle = .Default statusBarStyle = .Default
sideNavigationController?.enabled = false navigationDrawerController?.enabled = false
} }
override func viewDidAppear(animated: Bool) { override func viewDidAppear(animated: Bool) {
...@@ -57,7 +57,7 @@ class AppSearchBarController: SearchBarController { ...@@ -57,7 +57,7 @@ class AppSearchBarController: SearchBarController {
override func viewWillDisappear(animated: Bool) { override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated) super.viewWillDisappear(animated)
searchBar.textField.resignFirstResponder() searchBar.textField.resignFirstResponder()
sideNavigationController?.enabled = true navigationDrawerController?.enabled = true
} }
/// Toggle SideSearchViewController left UIViewController. /// Toggle SideSearchViewController left UIViewController.
......
...@@ -74,7 +74,7 @@ class ItemViewController: UIViewController { ...@@ -74,7 +74,7 @@ class ItemViewController: UIViewController {
override func viewWillAppear(animated: Bool) { override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
sideNavigationController?.enabled = false navigationDrawerController?.enabled = false
} }
override func viewWillLayoutSubviews() { override func viewWillLayoutSubviews() {
......
...@@ -51,7 +51,7 @@ class RecipesViewController: UIViewController { ...@@ -51,7 +51,7 @@ class RecipesViewController: UIViewController {
automaticallyAdjustsScrollViewInsets = true automaticallyAdjustsScrollViewInsets = true
// Enable the SideNavigation. // Enable the SideNavigation.
sideNavigationController?.enabled = true navigationDrawerController?.enabled = true
} }
/// Prepares the items Array. /// Prepares the items Array.
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
96E5E4671CC1E5EC0054837B /* PurpleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */; }; 96CB75011D0DFDBB0012D9F2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75001D0DFDBB0012D9F2 /* AppDelegate.swift */; };
96E5E4691CC1E6130054837B /* OrangeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E4681CC1E6130054837B /* OrangeViewController.swift */; }; 96CB75031D0DFDBB0012D9F2 /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75021D0DFDBB0012D9F2 /* AppLeftViewController.swift */; };
96E5E46B1CC1E8FB0054837B /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E46A1CC1E8FB0054837B /* AppLeftViewController.swift */; }; 96CB75081D0DFDBB0012D9F2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96CB75071D0DFDBB0012D9F2 /* Assets.xcassets */; };
96F2F2051C97A68800A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1FD1C97A68800A5FE27 /* AppDelegate.swift */; }; 96CB750B1D0DFDBB0012D9F2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96CB75091D0DFDBB0012D9F2 /* LaunchScreen.storyboard */; };
96F2F2061C97A68800A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1FE1C97A68800A5FE27 /* Assets.xcassets */; }; 96CB75131D0DFF6F0012D9F2 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75121D0DFF6F0012D9F2 /* YellowViewController.swift */; };
96F2F2071C97A68800A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1FF1C97A68800A5FE27 /* LaunchScreen.storyboard */; }; 96CB75151D0DFF840012D9F2 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75141D0DFF840012D9F2 /* BlueViewController.swift */; };
96F2F2081C97A68800A5FE27 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2011C97A68800A5FE27 /* BlueViewController.swift */; }; 96CB75171D0DFF9C0012D9F2 /* GreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75161D0DFF9C0012D9F2 /* GreenViewController.swift */; };
96F2F2091C97A68800A5FE27 /* GreenViewcontroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2021C97A68800A5FE27 /* GreenViewcontroller.swift */; }; 96CB75191D0DFFAE0012D9F2 /* PurpleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75181D0DFFAE0012D9F2 /* PurpleViewController.swift */; };
96F2F20B1C97A68800A5FE27 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2041C97A68800A5FE27 /* YellowViewController.swift */; }; 96CB751B1D0DFFC10012D9F2 /* OrangeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB751A1D0DFFC10012D9F2 /* OrangeViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
9663F9831C7ADD7800AF0965 /* Embed Frameworks */ = { 96CB75431D0E038A0012D9F2 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
dstPath = ""; dstPath = "";
...@@ -32,21 +32,21 @@ ...@@ -32,21 +32,21 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9663F9651C7ADCB600AF0965 /* SideNavigationController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigationController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 96CB74FD1D0DFDBB0012D9F2 /* NavigationDrawerController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationDrawerController.app; sourceTree = BUILT_PRODUCTS_DIR; };
96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PurpleViewController.swift; sourceTree = "<group>"; }; 96CB75001D0DFDBB0012D9F2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96E5E4681CC1E6130054837B /* OrangeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrangeViewController.swift; sourceTree = "<group>"; }; 96CB75021D0DFDBB0012D9F2 /* AppLeftViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLeftViewController.swift; sourceTree = "<group>"; };
96E5E46A1CC1E8FB0054837B /* AppLeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppLeftViewController.swift; sourceTree = "<group>"; }; 96CB75071D0DFDBB0012D9F2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96F2F1FD1C97A68800A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96CB750A1D0DFDBB0012D9F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96F2F1FE1C97A68800A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96CB750C1D0DFDBC0012D9F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96F2F2001C97A68800A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96CB75121D0DFF6F0012D9F2 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; };
96F2F2011C97A68800A5FE27 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; }; 96CB75141D0DFF840012D9F2 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; };
96F2F2021C97A68800A5FE27 /* GreenViewcontroller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewcontroller.swift; sourceTree = "<group>"; }; 96CB75161D0DFF9C0012D9F2 /* GreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewController.swift; sourceTree = "<group>"; };
96F2F2031C97A68800A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96CB75181D0DFFAE0012D9F2 /* PurpleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PurpleViewController.swift; sourceTree = "<group>"; };
96F2F2041C97A68800A5FE27 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; }; 96CB751A1D0DFFC10012D9F2 /* OrangeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrangeViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
9663F9621C7ADCB600AF0965 /* Frameworks */ = { 96CB74FA1D0DFDBB0012D9F2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
...@@ -56,76 +56,76 @@ ...@@ -56,76 +56,76 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
9663F95C1C7ADCB600AF0965 = { 96CB74F41D0DFDBB0012D9F2 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96F2F1FC1C97A68800A5FE27 /* SideNavigationController */, 96CB74FF1D0DFDBB0012D9F2 /* NavigationDrawerController */,
9663F9661C7ADCB600AF0965 /* Products */, 96CB74FE1D0DFDBB0012D9F2 /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9663F9661C7ADCB600AF0965 /* Products */ = { 96CB74FE1D0DFDBB0012D9F2 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9663F9651C7ADCB600AF0965 /* SideNavigationController.app */, 96CB74FD1D0DFDBB0012D9F2 /* NavigationDrawerController.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96F2F1FC1C97A68800A5FE27 /* SideNavigationController */ = { 96CB74FF1D0DFDBB0012D9F2 /* NavigationDrawerController */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96F2F1FD1C97A68800A5FE27 /* AppDelegate.swift */, 96CB75001D0DFDBB0012D9F2 /* AppDelegate.swift */,
96E5E46A1CC1E8FB0054837B /* AppLeftViewController.swift */, 96CB75021D0DFDBB0012D9F2 /* AppLeftViewController.swift */,
96F2F2041C97A68800A5FE27 /* YellowViewController.swift */, 96CB75121D0DFF6F0012D9F2 /* YellowViewController.swift */,
96F2F2011C97A68800A5FE27 /* BlueViewController.swift */, 96CB75141D0DFF840012D9F2 /* BlueViewController.swift */,
96F2F2021C97A68800A5FE27 /* GreenViewcontroller.swift */, 96CB75161D0DFF9C0012D9F2 /* GreenViewController.swift */,
96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */, 96CB75181D0DFFAE0012D9F2 /* PurpleViewController.swift */,
96E5E4681CC1E6130054837B /* OrangeViewController.swift */, 96CB751A1D0DFFC10012D9F2 /* OrangeViewController.swift */,
96F2F1FE1C97A68800A5FE27 /* Assets.xcassets */, 96CB75071D0DFDBB0012D9F2 /* Assets.xcassets */,
96F2F1FF1C97A68800A5FE27 /* LaunchScreen.storyboard */, 96CB75091D0DFDBB0012D9F2 /* LaunchScreen.storyboard */,
96F2F2031C97A68800A5FE27 /* Info.plist */, 96CB750C1D0DFDBC0012D9F2 /* Info.plist */,
); );
path = SideNavigationController; path = NavigationDrawerController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
9663F9641C7ADCB600AF0965 /* SideNavigationController */ = { 96CB74FC1D0DFDBB0012D9F2 /* NavigationDrawerController */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 9663F9771C7ADCB600AF0965 /* Build configuration list for PBXNativeTarget "SideNavigationController" */; buildConfigurationList = 96CB750F1D0DFDBC0012D9F2 /* Build configuration list for PBXNativeTarget "NavigationDrawerController" */;
buildPhases = ( buildPhases = (
9663F9611C7ADCB600AF0965 /* Sources */, 96CB74F91D0DFDBB0012D9F2 /* Sources */,
9663F9621C7ADCB600AF0965 /* Frameworks */, 96CB74FA1D0DFDBB0012D9F2 /* Frameworks */,
9663F9631C7ADCB600AF0965 /* Resources */, 96CB74FB1D0DFDBB0012D9F2 /* Resources */,
9663F9831C7ADD7800AF0965 /* Embed Frameworks */, 96CB75431D0E038A0012D9F2 /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
); );
name = SideNavigationController; name = NavigationDrawerController;
productName = SideNavigationViewController; productName = NavigationDrawerController;
productReference = 9663F9651C7ADCB600AF0965 /* SideNavigationController.app */; productReference = 96CB74FD1D0DFDBB0012D9F2 /* NavigationDrawerController.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
/* Begin PBXProject section */ /* Begin PBXProject section */
9663F95D1C7ADCB600AF0965 /* Project object */ = { 96CB74F51D0DFDBB0012D9F2 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0720; LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0720; LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "CosmicMind, Inc."; ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = { TargetAttributes = {
9663F9641C7ADCB600AF0965 = { 96CB74FC1D0DFDBB0012D9F2 = {
CreatedOnToolsVersion = 7.2.1; CreatedOnToolsVersion = 7.3.1;
}; };
}; };
}; };
buildConfigurationList = 9663F9601C7ADCB600AF0965 /* Build configuration list for PBXProject "SideNavigationController" */; buildConfigurationList = 96CB74F81D0DFDBB0012D9F2 /* Build configuration list for PBXProject "NavigationDrawerController" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
...@@ -133,50 +133,50 @@ ...@@ -133,50 +133,50 @@
en, en,
Base, Base,
); );
mainGroup = 9663F95C1C7ADCB600AF0965; mainGroup = 96CB74F41D0DFDBB0012D9F2;
productRefGroup = 9663F9661C7ADCB600AF0965 /* Products */; productRefGroup = 96CB74FE1D0DFDBB0012D9F2 /* Products */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
9663F9641C7ADCB600AF0965 /* SideNavigationController */, 96CB74FC1D0DFDBB0012D9F2 /* NavigationDrawerController */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */ /* Begin PBXResourcesBuildPhase section */
9663F9631C7ADCB600AF0965 /* Resources */ = { 96CB74FB1D0DFDBB0012D9F2 /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96F2F2061C97A68800A5FE27 /* Assets.xcassets in Resources */, 96CB750B1D0DFDBB0012D9F2 /* LaunchScreen.storyboard in Resources */,
96F2F2071C97A68800A5FE27 /* LaunchScreen.storyboard in Resources */, 96CB75081D0DFDBB0012D9F2 /* Assets.xcassets in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
9663F9611C7ADCB600AF0965 /* Sources */ = { 96CB74F91D0DFDBB0012D9F2 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96F2F20B1C97A68800A5FE27 /* YellowViewController.swift in Sources */, 96CB75031D0DFDBB0012D9F2 /* AppLeftViewController.swift in Sources */,
96F2F2081C97A68800A5FE27 /* BlueViewController.swift in Sources */, 96CB75131D0DFF6F0012D9F2 /* YellowViewController.swift in Sources */,
96E5E4691CC1E6130054837B /* OrangeViewController.swift in Sources */, 96CB75191D0DFFAE0012D9F2 /* PurpleViewController.swift in Sources */,
96E5E4671CC1E5EC0054837B /* PurpleViewController.swift in Sources */, 96CB75151D0DFF840012D9F2 /* BlueViewController.swift in Sources */,
96F2F2051C97A68800A5FE27 /* AppDelegate.swift in Sources */, 96CB75011D0DFDBB0012D9F2 /* AppDelegate.swift in Sources */,
96E5E46B1CC1E8FB0054837B /* AppLeftViewController.swift in Sources */, 96CB751B1D0DFFC10012D9F2 /* OrangeViewController.swift in Sources */,
96F2F2091C97A68800A5FE27 /* GreenViewcontroller.swift in Sources */, 96CB75171D0DFF9C0012D9F2 /* GreenViewController.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
96F2F1FF1C97A68800A5FE27 /* LaunchScreen.storyboard */ = { 96CB75091D0DFDBB0012D9F2 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
96F2F2001C97A68800A5FE27 /* Base */, 96CB750A1D0DFDBB0012D9F2 /* Base */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -184,10 +184,11 @@ ...@@ -184,10 +184,11 @@
/* End PBXVariantGroup section */ /* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
9663F9751C7ADCB600AF0965 /* Debug */ = { 96CB750D1D0DFDBC0012D9F2 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
...@@ -229,10 +230,11 @@ ...@@ -229,10 +230,11 @@
}; };
name = Debug; name = Debug;
}; };
9663F9761C7ADCB600AF0965 /* Release */ = { 96CB750E1D0DFDBC0012D9F2 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
...@@ -267,50 +269,50 @@ ...@@ -267,50 +269,50 @@
}; };
name = Release; name = Release;
}; };
9663F9781C7ADCB600AF0965 /* Debug */ = { 96CB75101D0DFDBC0012D9F2 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "$(SRCROOT)/SideNavigationController/Info.plist"; INFOPLIST_FILE = NavigationDrawerController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationDrawerController;
PRODUCT_NAME = SideNavigationController; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = Debug; name = Debug;
}; };
9663F9791C7ADCB600AF0965 /* Release */ = { 96CB75111D0DFDBC0012D9F2 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "$(SRCROOT)/SideNavigationController/Info.plist"; INFOPLIST_FILE = NavigationDrawerController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationDrawerController;
PRODUCT_NAME = SideNavigationController; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
9663F9601C7ADCB600AF0965 /* Build configuration list for PBXProject "SideNavigationController" */ = { 96CB74F81D0DFDBB0012D9F2 /* Build configuration list for PBXProject "NavigationDrawerController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9663F9751C7ADCB600AF0965 /* Debug */, 96CB750D1D0DFDBC0012D9F2 /* Debug */,
9663F9761C7ADCB600AF0965 /* Release */, 96CB750E1D0DFDBC0012D9F2 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
9663F9771C7ADCB600AF0965 /* Build configuration list for PBXNativeTarget "SideNavigationController" */ = { 96CB750F1D0DFDBC0012D9F2 /* Build configuration list for PBXNativeTarget "NavigationDrawerController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9663F9781C7ADCB600AF0965 /* Debug */, 96CB75101D0DFDBC0012D9F2 /* Debug */,
9663F9791C7ADCB600AF0965 /* Release */, 96CB75111D0DFDBC0012D9F2 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };
rootObject = 9663F95D1C7ADCB600AF0965 /* Project object */; rootObject = 96CB74F51D0DFDBB0012D9F2 /* Project object */;
} }
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:SideNavigationViewController.xcodeproj"> location = "self:NavigationDrawerController.xcodeproj">
</FileRef> </FileRef>
</Workspace> </Workspace>
...@@ -38,20 +38,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,20 +38,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let navigationController: NavigationController = NavigationController(rootViewController: YellowViewController()) let navigationController: NavigationController = NavigationController(rootViewController: YellowViewController())
let sideNavigationController: SideNavigationController = SideNavigationController(rootViewController: navigationController, leftViewController: AppLeftViewController(), rightViewController: BlueViewController()) let navigationDrawerController: NavigationDrawerController = NavigationDrawerController(rootViewController: navigationController, leftViewController: AppLeftViewController(), rightViewController: BlueViewController())
// sideNavigationController.enabled = true // navigationDrawerController.enabled = true
// //
// sideNavigationController.enabledLeftView = true // navigationDrawerController.enabledLeftView = true
// sideNavigationController.enabledLeftTapGesture = true // navigationDrawerController.enabledLeftTapGesture = true
// sideNavigationController.enabledLeftPanGesture = true // navigationDrawerController.enabledLeftPanGesture = true
// //
// sideNavigationController.enabledRightView = true // navigationDrawerController.enabledRightView = true
// sideNavigationController.enabledRightTapGesture = true // navigationDrawerController.enabledRightTapGesture = true
// sideNavigationController.enabledRightPanGesture = true // navigationDrawerController.enabledRightPanGesture = true
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = sideNavigationController window!.rootViewController = navigationDrawerController
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
} }
......
...@@ -74,8 +74,8 @@ class AppLeftViewController: UIViewController { ...@@ -74,8 +74,8 @@ class AppLeftViewController: UIViewController {
tableView.delegate = self tableView.delegate = self
tableView.separatorStyle = .None tableView.separatorStyle = .None
// Use Layout to easily align the tableView. // Use Layout to easily align the tableView.
view.layout(tableView).edges(top: 170) view.layout(tableView).edges(top: 170)
} }
} }
...@@ -116,22 +116,22 @@ extension AppLeftViewController: UITableViewDelegate { ...@@ -116,22 +116,22 @@ extension AppLeftViewController: UITableViewDelegate {
switch item.text { switch item.text {
case "Orange": case "Orange":
sideNavigationController?.transitionFromRootViewController(OrangeViewController()) navigationDrawerController?.transitionFromRootViewController(OrangeViewController())
case "Purple": case "Purple":
sideNavigationController?.transitionFromRootViewController(PurpleViewController()) navigationDrawerController?.transitionFromRootViewController(PurpleViewController())
case "Green": case "Green":
sideNavigationController?.transitionFromRootViewController(GreenViewController()) navigationDrawerController?.transitionFromRootViewController(GreenViewController())
case "Blue": case "Blue":
sideNavigationController?.transitionFromRootViewController(BlueViewController()) navigationDrawerController?.transitionFromRootViewController(BlueViewController())
case "Yellow": case "Yellow":
// To close the sideNavigationController after loading the UIViewController, use the following. // To close the navigationDrawerController after loading the UIViewController, use the following.
sideNavigationController?.transitionFromRootViewController(YellowViewController(), navigationDrawerController?.transitionFromRootViewController(YellowViewController(),
duration: 1, duration: 1,
options: .TransitionNone, options: .TransitionNone,
animations: nil, animations: nil,
completion: { [weak self] _ in completion: { [weak self] _ in
self?.sideNavigationController?.closeLeftView() self?.navigationDrawerController?.closeLeftView()
}) })
default:break default:break
} }
} }
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
......
...@@ -44,7 +44,7 @@ class AppToolbarController: ToolbarController { ...@@ -44,7 +44,7 @@ class AppToolbarController: ToolbarController {
prepareToolbar() prepareToolbar()
} }
/// Toggle SideNavigationController right UIViewController. /// Toggle NavigationDrawerController right UIViewController.
internal func handleSearchButton() { internal func handleSearchButton() {
floatingViewController = GreenViewController() floatingViewController = GreenViewController()
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
96F2F2251C97B00D00A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F21C1C97B00D00A5FE27 /* AppDelegate.swift */; }; 96CB75291D0E00300012D9F2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB75281D0E00300012D9F2 /* AppDelegate.swift */; };
96F2F2261C97B00D00A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F21D1C97B00D00A5FE27 /* Assets.xcassets */; }; 96CB752B1D0E00300012D9F2 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB752A1D0E00300012D9F2 /* RootViewController.swift */; };
96F2F2271C97B00D00A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F21E1C97B00D00A5FE27 /* LaunchScreen.storyboard */; }; 96CB752E1D0E00300012D9F2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96CB752C1D0E00300012D9F2 /* Main.storyboard */; };
96F2F2281C97B00D00A5FE27 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F2201C97B00D00A5FE27 /* Main.storyboard */; }; 96CB75301D0E00300012D9F2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96CB752F1D0E00300012D9F2 /* Assets.xcassets */; };
96F2F22A1C97B00D00A5FE27 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2231C97B00D00A5FE27 /* MainViewController.swift */; }; 96CB75331D0E00300012D9F2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96CB75311D0E00300012D9F2 /* LaunchScreen.storyboard */; };
96F2F22B1C97B00D00A5FE27 /* SideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2241C97B00D00A5FE27 /* SideViewController.swift */; }; 96CB753B1D0E01520012D9F2 /* DrawerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CB753A1D0E01520012D9F2 /* DrawerViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
96668B2E1C2A3052001916C7 /* Embed Frameworks */ = { 96CB753F1D0E02F40012D9F2 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
dstPath = ""; dstPath = "";
...@@ -29,18 +29,18 @@ ...@@ -29,18 +29,18 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
96F2F21C1C97B00D00A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96CB75251D0E00300012D9F2 /* NavigationDrawerController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationDrawerController.app; sourceTree = BUILT_PRODUCTS_DIR; };
96F2F21D1C97B00D00A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96CB75281D0E00300012D9F2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96F2F21F1C97B00D00A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96CB752A1D0E00300012D9F2 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = "<group>"; };
96F2F2211C97B00D00A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 96CB752D1D0E00300012D9F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
96F2F2221C97B00D00A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96CB752F1D0E00300012D9F2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96F2F2231C97B00D00A5FE27 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; }; 96CB75321D0E00300012D9F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96F2F2241C97B00D00A5FE27 /* SideViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideViewController.swift; sourceTree = "<group>"; }; 96CB75341D0E00300012D9F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9ABEC55B1C151BB000F6895E /* SideNavigationController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigationController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 96CB753A1D0E01520012D9F2 /* DrawerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DrawerViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
9ABEC5581C151BB000F6895E /* Frameworks */ = { 96CB75221D0E00300012D9F2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
...@@ -50,73 +50,73 @@ ...@@ -50,73 +50,73 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
96F2F21B1C97B00D00A5FE27 /* SideNavigationController */ = { 96CB751C1D0E00300012D9F2 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96F2F21C1C97B00D00A5FE27 /* AppDelegate.swift */, 96CB75271D0E00300012D9F2 /* NavigationDrawerController */,
96F2F2231C97B00D00A5FE27 /* MainViewController.swift */, 96CB75261D0E00300012D9F2 /* Products */,
96F2F2241C97B00D00A5FE27 /* SideViewController.swift */,
96F2F21D1C97B00D00A5FE27 /* Assets.xcassets */,
96F2F21E1C97B00D00A5FE27 /* LaunchScreen.storyboard */,
96F2F2201C97B00D00A5FE27 /* Main.storyboard */,
96F2F2221C97B00D00A5FE27 /* Info.plist */,
); );
path = SideNavigationController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9ABEC5521C151BB000F6895E = { 96CB75261D0E00300012D9F2 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96F2F21B1C97B00D00A5FE27 /* SideNavigationController */, 96CB75251D0E00300012D9F2 /* NavigationDrawerController.app */,
9ABEC55C1C151BB000F6895E /* Products */,
); );
name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9ABEC55C1C151BB000F6895E /* Products */ = { 96CB75271D0E00300012D9F2 /* NavigationDrawerController */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9ABEC55B1C151BB000F6895E /* SideNavigationController.app */, 96CB75281D0E00300012D9F2 /* AppDelegate.swift */,
96CB752A1D0E00300012D9F2 /* RootViewController.swift */,
96CB753A1D0E01520012D9F2 /* DrawerViewController.swift */,
96CB752C1D0E00300012D9F2 /* Main.storyboard */,
96CB752F1D0E00300012D9F2 /* Assets.xcassets */,
96CB75311D0E00300012D9F2 /* LaunchScreen.storyboard */,
96CB75341D0E00300012D9F2 /* Info.plist */,
); );
name = Products; path = NavigationDrawerController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
9ABEC55A1C151BB000F6895E /* SideNavigationController */ = { 96CB75241D0E00300012D9F2 /* NavigationDrawerController */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 9ABEC56D1C151BB000F6895E /* Build configuration list for PBXNativeTarget "SideNavigationController" */; buildConfigurationList = 96CB75371D0E00300012D9F2 /* Build configuration list for PBXNativeTarget "NavigationDrawerController" */;
buildPhases = ( buildPhases = (
9ABEC5571C151BB000F6895E /* Sources */, 96CB75211D0E00300012D9F2 /* Sources */,
9ABEC5581C151BB000F6895E /* Frameworks */, 96CB75221D0E00300012D9F2 /* Frameworks */,
9ABEC5591C151BB000F6895E /* Resources */, 96CB75231D0E00300012D9F2 /* Resources */,
96668B2E1C2A3052001916C7 /* Embed Frameworks */, 96CB753F1D0E02F40012D9F2 /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
); );
name = SideNavigationController; name = NavigationDrawerController;
productName = SideNavigationViewController; productName = NavigationDrawerController;
productReference = 9ABEC55B1C151BB000F6895E /* SideNavigationController.app */; productReference = 96CB75251D0E00300012D9F2 /* NavigationDrawerController.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
/* Begin PBXProject section */ /* Begin PBXProject section */
9ABEC5531C151BB000F6895E /* Project object */ = { 96CB751D1D0E00300012D9F2 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0710; LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0710; LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "Adam Dahan"; ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = { TargetAttributes = {
9ABEC55A1C151BB000F6895E = { 96CB75241D0E00300012D9F2 = {
CreatedOnToolsVersion = 7.1.1; CreatedOnToolsVersion = 7.3.1;
}; };
}; };
}; };
buildConfigurationList = 9ABEC5561C151BB000F6895E /* Build configuration list for PBXProject "SideNavigationController" */; buildConfigurationList = 96CB75201D0E00300012D9F2 /* Build configuration list for PBXProject "NavigationDrawerController" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
...@@ -124,66 +124,67 @@ ...@@ -124,66 +124,67 @@
en, en,
Base, Base,
); );
mainGroup = 9ABEC5521C151BB000F6895E; mainGroup = 96CB751C1D0E00300012D9F2;
productRefGroup = 9ABEC55C1C151BB000F6895E /* Products */; productRefGroup = 96CB75261D0E00300012D9F2 /* Products */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
9ABEC55A1C151BB000F6895E /* SideNavigationController */, 96CB75241D0E00300012D9F2 /* NavigationDrawerController */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */ /* Begin PBXResourcesBuildPhase section */
9ABEC5591C151BB000F6895E /* Resources */ = { 96CB75231D0E00300012D9F2 /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96F2F2281C97B00D00A5FE27 /* Main.storyboard in Resources */, 96CB75331D0E00300012D9F2 /* LaunchScreen.storyboard in Resources */,
96F2F2261C97B00D00A5FE27 /* Assets.xcassets in Resources */, 96CB75301D0E00300012D9F2 /* Assets.xcassets in Resources */,
96F2F2271C97B00D00A5FE27 /* LaunchScreen.storyboard in Resources */, 96CB752E1D0E00300012D9F2 /* Main.storyboard in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
9ABEC5571C151BB000F6895E /* Sources */ = { 96CB75211D0E00300012D9F2 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96F2F2251C97B00D00A5FE27 /* AppDelegate.swift in Sources */, 96CB752B1D0E00300012D9F2 /* RootViewController.swift in Sources */,
96F2F22A1C97B00D00A5FE27 /* MainViewController.swift in Sources */, 96CB75291D0E00300012D9F2 /* AppDelegate.swift in Sources */,
96F2F22B1C97B00D00A5FE27 /* SideViewController.swift in Sources */, 96CB753B1D0E01520012D9F2 /* DrawerViewController.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
96F2F21E1C97B00D00A5FE27 /* LaunchScreen.storyboard */ = { 96CB752C1D0E00300012D9F2 /* Main.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
96F2F21F1C97B00D00A5FE27 /* Base */, 96CB752D1D0E00300012D9F2 /* Base */,
); );
name = LaunchScreen.storyboard; name = Main.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96F2F2201C97B00D00A5FE27 /* Main.storyboard */ = { 96CB75311D0E00300012D9F2 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
96F2F2211C97B00D00A5FE27 /* Base */, 96CB75321D0E00300012D9F2 /* Base */,
); );
name = Main.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXVariantGroup section */ /* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
9ABEC56B1C151BB000F6895E /* Debug */ = { 96CB75351D0E00300012D9F2 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
...@@ -216,18 +217,20 @@ ...@@ -216,18 +217,20 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
}; };
9ABEC56C1C151BB000F6895E /* Release */ = { 96CB75361D0E00300012D9F2 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
...@@ -254,59 +257,58 @@ ...@@ -254,59 +257,58 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
name = Release; name = Release;
}; };
9ABEC56E1C151BB000F6895E /* Debug */ = { 96CB75381D0E00300012D9F2 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "$(SRCROOT)/SideNavigationController/Info.plist"; INFOPLIST_FILE = NavigationDrawerController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationDrawerController;
PRODUCT_NAME = SideNavigationController; PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
}; };
9ABEC56F1C151BB000F6895E /* Release */ = { 96CB75391D0E00300012D9F2 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "$(SRCROOT)/SideNavigationController/Info.plist"; INFOPLIST_FILE = NavigationDrawerController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationDrawerController;
PRODUCT_NAME = SideNavigationController; PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
9ABEC5561C151BB000F6895E /* Build configuration list for PBXProject "SideNavigationController" */ = { 96CB75201D0E00300012D9F2 /* Build configuration list for PBXProject "NavigationDrawerController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9ABEC56B1C151BB000F6895E /* Debug */, 96CB75351D0E00300012D9F2 /* Debug */,
9ABEC56C1C151BB000F6895E /* Release */, 96CB75361D0E00300012D9F2 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
9ABEC56D1C151BB000F6895E /* Build configuration list for PBXNativeTarget "SideNavigationController" */ = { 96CB75371D0E00300012D9F2 /* Build configuration list for PBXNativeTarget "NavigationDrawerController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9ABEC56E1C151BB000F6895E /* Debug */, 96CB75381D0E00300012D9F2 /* Debug */,
9ABEC56F1C151BB000F6895E /* Release */, 96CB75391D0E00300012D9F2 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };
rootObject = 9ABEC5531C151BB000F6895E /* Project object */; rootObject = 96CB751D1D0E00300012D9F2 /* Project object */;
} }
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:SideNavigationViewController.xcodeproj"> location = "self:NavigationDrawerController.xcodeproj">
</FileRef> </FileRef>
</Workspace> </Workspace>
...@@ -33,45 +33,45 @@ import Material ...@@ -33,45 +33,45 @@ import Material
@UIApplicationMain @UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate { class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Get view controllers from storyboard // Get view controllers from storyboard
let storyboard = UIStoryboard(name: "Main", bundle: nil) let storyboard = UIStoryboard(name: "Main", bundle: nil)
let rootViewController = storyboard.instantiateViewControllerWithIdentifier("RootViewController") as! RootViewController let rootViewController = storyboard.instantiateViewControllerWithIdentifier("RootViewController") as! RootViewController
let sideViewController = storyboard.instantiateViewControllerWithIdentifier("SideViewController") as! SideViewController let drawerViewController = storyboard.instantiateViewControllerWithIdentifier("DrawerViewController") as! DrawerViewController
// Configure the window with the SideNavigationController as the root view controller // Configure the window with the NavigationDrawerController as the root view controller
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = SideNavigationController(rootViewController: rootViewController, leftViewController: sideViewController) window?.rootViewController = NavigationDrawerController(rootViewController: rootViewController, leftViewController: drawerViewController)
window?.makeKeyAndVisible() window?.makeKeyAndVisible()
return true 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. // 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 throttle down OpenGL ES frame rates. 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. // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
} }
func applicationWillEnterForeground(application: UIApplication) { 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. // 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 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. // 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:. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} }
} }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies> <dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Root View Controller--> <!--Root View Controller-->
<scene sceneID="S32-pp-djU"> <scene sceneID="tne-QT-ifu">
<objects> <objects>
<viewController storyboardIdentifier="RootViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="huh-WT-4zU" customClass="RootViewController" customModule="SideNavigationViewController" customModuleProvider="target" sceneMemberID="viewController"> <viewController id="BYZ-38-t0r" customClass="RootViewController" customModule="NavigationDrawerController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="778-lO-FMj"/> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="hvu-kv-aLI"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="I6q-Is-0pO"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.3590823447" green="0.30467909450000003" blue="0.81552683250000002" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="I7q-uB-Qez" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="302" y="-329"/>
</scene> </scene>
<!--Side View Controller--> <!--Drawer View Controller-->
<scene sceneID="tne-QT-ifu"> <scene sceneID="hLH-kg-mtG">
<objects> <objects>
<viewController storyboardIdentifier="SideViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="SideViewController" customModule="SideNavigationViewController" customModuleProvider="target" sceneMemberID="viewController"> <viewController id="06L-FT-Qi1" customClass="DrawerViewController" customModule="NavigationDrawerController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="top" id="6wn-C8-Wj8"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> <viewControllerLayoutGuide type="bottom" id="2M5-ul-HvM"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <view key="view" contentMode="scaleToFill" id="e7g-Fd-L6H">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="h7a-OV-6Fo" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="1575" y="913"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
import UIKit import UIKit
class SideViewController: UIViewController { class DrawerViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib. // Do any additional setup after loading the view, typically from a nib.
} }
} }
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
<true/> <true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
<array> <array>
<string>armv7</string> <string>armv7</string>
...@@ -33,7 +35,13 @@ ...@@ -33,7 +35,13 @@
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
</dict> </dict>
</plist> </plist>
...@@ -32,23 +32,23 @@ import UIKit ...@@ -32,23 +32,23 @@ import UIKit
import Material import Material
class RootViewController: UIViewController { class RootViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib. // Do any additional setup after loading the view, typically from a nib.
// Toggle SideNavigationController. // Toggle NavigationDrawerController.
let img: UIImage? = UIImage(named: "ic_create_white") let img: UIImage? = MaterialIcon.cm.pen
let fabButton: FabButton = FabButton() let fabButton: FabButton = FabButton()
fabButton.setImage(img, forState: .Normal) fabButton.setImage(img, forState: .Normal)
fabButton.setImage(img, forState: .Highlighted) fabButton.setImage(img, forState: .Highlighted)
fabButton.addTarget(self, action: #selector(handleFabButton), forControlEvents: .TouchUpInside) fabButton.addTarget(self, action: #selector(handleFabButton), forControlEvents: .TouchUpInside)
view.layout(fabButton).width(64).height(64).bottom(16).right(16) view.layout(fabButton).width(64).height(64).bottom(16).right(16)
} }
// FabButton handler. // FabButton handler.
func handleFabButton() { func handleFabButton() {
sideNavigationController?.toggleLeftView() navigationDrawerController?.toggleLeftView()
} }
} }
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_create_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_create_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_create_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
96BCB7DD1CB40DC500C806FE /* RobotoFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7941CB40DC500C806FE /* RobotoFont.swift */; }; 96BCB7DD1CB40DC500C806FE /* RobotoFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7941CB40DC500C806FE /* RobotoFont.swift */; };
96BCB7DE1CB40DC500C806FE /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; }; 96BCB7DE1CB40DC500C806FE /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; };
96BCB7DF1CB40DC500C806FE /* SearchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; }; 96BCB7DF1CB40DC500C806FE /* SearchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; };
96BCB7E01CB40DC500C806FE /* SideNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* SideNavigationController.swift */; }; 96BCB7E01CB40DC500C806FE /* NavigationDrawerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */; };
96BCB7E11CB40DC500C806FE /* BarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* BarView.swift */; }; 96BCB7E11CB40DC500C806FE /* BarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* BarView.swift */; };
96BCB7E21CB40DC500C806FE /* BarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* BarController.swift */; }; 96BCB7E21CB40DC500C806FE /* BarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* BarController.swift */; };
96BCB7E31CB40DC500C806FE /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB79A1CB40DC500C806FE /* TabBar.swift */; }; 96BCB7E31CB40DC500C806FE /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB79A1CB40DC500C806FE /* TabBar.swift */; };
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
96BCB8381CB4115200C806FE /* ControlView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB75E1CB40DC500C806FE /* ControlView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8381CB4115200C806FE /* ControlView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB75E1CB40DC500C806FE /* ControlView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83B1CB4115200C806FE /* SideNavigationController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* SideNavigationController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83B1CB4115200C806FE /* NavigationDrawerController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83C1CB4115200C806FE /* BarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* BarView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83C1CB4115200C806FE /* BarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* BarView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83D1CB4115200C806FE /* BarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* BarController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83D1CB4115200C806FE /* BarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* BarController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83E1CB4115200C806FE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78D1CB40DC500C806FE /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83E1CB4115200C806FE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78D1CB40DC500C806FE /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; };
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
96BCB7941CB40DC500C806FE /* RobotoFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RobotoFont.swift; sourceTree = "<group>"; }; 96BCB7941CB40DC500C806FE /* RobotoFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RobotoFont.swift; sourceTree = "<group>"; };
96BCB7951CB40DC500C806FE /* SearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; }; 96BCB7951CB40DC500C806FE /* SearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; };
96BCB7961CB40DC500C806FE /* SearchBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarController.swift; sourceTree = "<group>"; }; 96BCB7961CB40DC500C806FE /* SearchBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarController.swift; sourceTree = "<group>"; };
96BCB7971CB40DC500C806FE /* SideNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideNavigationController.swift; sourceTree = "<group>"; }; 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationDrawerController.swift; sourceTree = "<group>"; };
96BCB7981CB40DC500C806FE /* BarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarView.swift; sourceTree = "<group>"; }; 96BCB7981CB40DC500C806FE /* BarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarView.swift; sourceTree = "<group>"; };
96BCB7991CB40DC500C806FE /* BarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarController.swift; sourceTree = "<group>"; }; 96BCB7991CB40DC500C806FE /* BarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarController.swift; sourceTree = "<group>"; };
96BCB79A1CB40DC500C806FE /* TabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; }; 96BCB79A1CB40DC500C806FE /* TabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; };
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
96BCB7901CB40DC500C806FE /* NavigationBar.swift */, 96BCB7901CB40DC500C806FE /* NavigationBar.swift */,
96BCB7911CB40DC500C806FE /* NavigationController.swift */, 96BCB7911CB40DC500C806FE /* NavigationController.swift */,
96BCB7921CB40DC500C806FE /* NavigationItem.swift */, 96BCB7921CB40DC500C806FE /* NavigationItem.swift */,
96BCB7971CB40DC500C806FE /* SideNavigationController.swift */, 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */,
); );
name = Navigation; name = Navigation;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -674,7 +674,7 @@ ...@@ -674,7 +674,7 @@
96BCB8381CB4115200C806FE /* ControlView.swift in Headers */, 96BCB8381CB4115200C806FE /* ControlView.swift in Headers */,
96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */, 96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */,
96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */, 96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */,
96BCB83B1CB4115200C806FE /* SideNavigationController.swift in Headers */, 96BCB83B1CB4115200C806FE /* NavigationDrawerController.swift in Headers */,
96BCB83C1CB4115200C806FE /* BarView.swift in Headers */, 96BCB83C1CB4115200C806FE /* BarView.swift in Headers */,
96BCB83D1CB4115200C806FE /* BarController.swift in Headers */, 96BCB83D1CB4115200C806FE /* BarController.swift in Headers */,
96BCB83E1CB4115200C806FE /* Menu.swift in Headers */, 96BCB83E1CB4115200C806FE /* Menu.swift in Headers */,
...@@ -943,7 +943,7 @@ ...@@ -943,7 +943,7 @@
96BCB7B61CB40DC500C806FE /* MaterialAnimation.swift in Sources */, 96BCB7B61CB40DC500C806FE /* MaterialAnimation.swift in Sources */,
96BCB7A71CB40DC500C806FE /* ControlView.swift in Sources */, 96BCB7A71CB40DC500C806FE /* ControlView.swift in Sources */,
96BCB7DB1CB40DC500C806FE /* NavigationItem.swift in Sources */, 96BCB7DB1CB40DC500C806FE /* NavigationItem.swift in Sources */,
96BCB7E01CB40DC500C806FE /* SideNavigationController.swift in Sources */, 96BCB7E01CB40DC500C806FE /* NavigationDrawerController.swift in Sources */,
96BCB7AD1CB40DC500C806FE /* Material+String.swift in Sources */, 96BCB7AD1CB40DC500C806FE /* Material+String.swift in Sources */,
96BCB7A51CB40DC500C806FE /* CaptureView.swift in Sources */, 96BCB7A51CB40DC500C806FE /* CaptureView.swift in Sources */,
96BCB7B01CB40DC500C806FE /* Material+UIImage+Color.swift in Sources */, 96BCB7B01CB40DC500C806FE /* Material+UIImage+Color.swift in Sources */,
......
...@@ -41,7 +41,7 @@ public class Layout { ...@@ -41,7 +41,7 @@ public class Layout {
An initializer that takes in a parent context. An initializer that takes in a parent context.
- Parameter parent: An optional parent UIView. - Parameter parent: An optional parent UIView.
*/ */
init(parent: UIView?) { public init(parent: UIView?) {
self.parent = parent self.parent = parent
} }
...@@ -50,7 +50,7 @@ public class Layout { ...@@ -50,7 +50,7 @@ public class Layout {
- Parameter parent: An optional parent UIView. - Parameter parent: An optional parent UIView.
- Parameter child: An optional child UIView. - Parameter child: An optional child UIView.
*/ */
init(parent: UIView?, child: UIView?) { public init(parent: UIView?, child: UIView?) {
self.parent = parent self.parent = parent
self.child = child self.child = child
} }
...@@ -61,7 +61,7 @@ public class Layout { ...@@ -61,7 +61,7 @@ public class Layout {
caused the issue. caused the issue.
- Returns: The current Layout instance. - Returns: The current Layout instance.
*/ */
public func debugParentNotAvailableMessage(function: String = #function) -> Layout { internal func debugParentNotAvailableMessage(function: String = #function) -> Layout {
debugPrint("[Material Layout Error: Parent view context is not available for \(function).") debugPrint("[Material Layout Error: Parent view context is not available for \(function).")
return self return self
} }
...@@ -72,7 +72,7 @@ public class Layout { ...@@ -72,7 +72,7 @@ public class Layout {
caused the issue. caused the issue.
- Returns: The current Layout instance. - Returns: The current Layout instance.
*/ */
public func debugChildNotAvailableMessage(function: String = #function) -> Layout { internal func debugChildNotAvailableMessage(function: String = #function) -> Layout {
debugPrint("[Material Layout Error: Chld view context is not available for \(function).") debugPrint("[Material Layout Error: Chld view context is not available for \(function).")
return self return self
} }
......
...@@ -66,7 +66,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -66,7 +66,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
public override func viewWillAppear(animated: Bool) { public override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
if let v: UIGestureRecognizer = interactivePopGestureRecognizer { if let v: UIGestureRecognizer = interactivePopGestureRecognizer {
if let x: SideNavigationController = sideNavigationController { if let x: NavigationDrawerController = navigationDrawerController {
if let l: UIPanGestureRecognizer = x.leftPanGesture { if let l: UIPanGestureRecognizer = x.leftPanGesture {
l.requireGestureRecognizerToFail(v) l.requireGestureRecognizerToFail(v)
} }
...@@ -89,7 +89,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -89,7 +89,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
/** /**
Detects the gesture recognizer being used. This is necessary when using Detects the gesture recognizer being used. This is necessary when using
SideNavigationController. It eliminates the conflict in panning. NavigationDrawerController. It eliminates the conflict in panning.
- Parameter gestureRecognizer: A UIGestureRecognizer to detect. - Parameter gestureRecognizer: A UIGestureRecognizer to detect.
- Parameter touch: The UITouch event. - Parameter touch: The UITouch event.
- Returns: A Boolean of whether to continue the gesture or not, true yes, false no. - Returns: A Boolean of whether to continue the gesture or not, true yes, false no.
......
...@@ -38,15 +38,15 @@ public enum SideNavigationPosition : NSInteger { ...@@ -38,15 +38,15 @@ public enum SideNavigationPosition : NSInteger {
public extension UIViewController { public extension UIViewController {
/** /**
A convenience property that provides access to the SideNavigationController. A convenience property that provides access to the NavigationDrawerController.
This is the recommended method of accessing the SideNavigationController This is the recommended method of accessing the NavigationDrawerController
through child UIViewControllers. through child UIViewControllers.
*/ */
public var sideNavigationController: SideNavigationController? { public var navigationDrawerController: NavigationDrawerController? {
var viewController: UIViewController? = self var viewController: UIViewController? = self
while nil != viewController { while nil != viewController {
if viewController is SideNavigationController { if viewController is NavigationDrawerController {
return viewController as? SideNavigationController return viewController as? NavigationDrawerController
} }
viewController = viewController?.parentViewController viewController = viewController?.parentViewController
} }
...@@ -54,66 +54,66 @@ public extension UIViewController { ...@@ -54,66 +54,66 @@ public extension UIViewController {
} }
} }
@objc(SideNavigationControllerDelegate) @objc(NavigationDrawerControllerDelegate)
public protocol SideNavigationControllerDelegate { public protocol NavigationDrawerControllerDelegate {
/** /**
An optional delegation method that is fired before the An optional delegation method that is fired before the
SideNavigationController opens. NavigationDrawerController opens.
*/ */
optional func sideNavigationWillOpen(sideNavigationController: SideNavigationController, position: SideNavigationPosition) optional func navigationDrawerWillOpen(navigationDrawerController: NavigationDrawerController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired after the An optional delegation method that is fired after the
SideNavigationController opened. NavigationDrawerController opened.
*/ */
optional func sideNavigationDidOpen(sideNavigationController: SideNavigationController, position: SideNavigationPosition) optional func navigationDrawerDidOpen(navigationDrawerController: NavigationDrawerController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired before the An optional delegation method that is fired before the
SideNavigationController closes. NavigationDrawerController closes.
*/ */
optional func sideNavigationWillClose(sideNavigationController: SideNavigationController, position: SideNavigationPosition) optional func navigationDrawerWillClose(navigationDrawerController: NavigationDrawerController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired after the An optional delegation method that is fired after the
SideNavigationController closed. NavigationDrawerController closed.
*/ */
optional func sideNavigationDidClose(sideNavigationController: SideNavigationController, position: SideNavigationPosition) optional func navigationDrawerDidClose(navigationDrawerController: NavigationDrawerController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationController pan gesture begins. NavigationDrawerController pan gesture begins.
*/ */
optional func sideNavigationPanDidBegin(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition) optional func navigationDrawerPanDidBegin(navigationDrawerController: NavigationDrawerController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationController pan gesture changes position. NavigationDrawerController pan gesture changes position.
*/ */
optional func sideNavigationPanDidChange(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition) optional func navigationDrawerPanDidChange(navigationDrawerController: NavigationDrawerController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationController pan gesture ends. NavigationDrawerController pan gesture ends.
*/ */
optional func sideNavigationPanDidEnd(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition) optional func navigationDrawerPanDidEnd(navigationDrawerController: NavigationDrawerController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationController tap gesture executes. NavigationDrawerController tap gesture executes.
*/ */
optional func sideNavigationDidTap(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition) optional func navigationDrawerDidTap(navigationDrawerController: NavigationDrawerController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
status bar is about to change display, hidden or not. status bar is about to change display, hidden or not.
*/ */
optional func sideNavigationStatusBarHiddenState(sideNavigationController: SideNavigationController, hidden: Bool) optional func navigationDrawerStatusBarHiddenState(navigationDrawerController: NavigationDrawerController, hidden: Bool)
} }
@IBDesignable @IBDesignable
@objc(SideNavigationController) @objc(NavigationDrawerController)
public class SideNavigationController : UIViewController, UIGestureRecognizerDelegate { public class NavigationDrawerController : UIViewController, UIGestureRecognizerDelegate {
/// A Boolean to determine if the statusBar will be hidden. /// A Boolean to determine if the statusBar will be hidden.
private var willHideStatusBar: Bool = false private var willHideStatusBar: Bool = false
...@@ -149,7 +149,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -149,7 +149,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/** /**
A CGFloat property that accesses the leftView threshold of A CGFloat property that accesses the leftView threshold of
the SideNavigationController. When the panning gesture has the NavigationDrawerController. When the panning gesture has
ended, if the position is beyond the threshold, ended, if the position is beyond the threshold,
the leftView is opened, if it is below the threshold, the the leftView is opened, if it is below the threshold, the
leftView is closed. The leftViewThreshold is always at half leftView is closed. The leftViewThreshold is always at half
...@@ -160,7 +160,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -160,7 +160,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/** /**
A CGFloat property that accesses the rightView threshold of A CGFloat property that accesses the rightView threshold of
the SideNavigationController. When the panning gesture has the NavigationDrawerController. When the panning gesture has
ended, if the position is beyond the threshold, ended, if the position is beyond the threshold,
the rightView is closed, if it is below the threshold, the the rightView is closed, if it is below the threshold, the
rightView is opened. The rightViewThreshold is always at half rightView is opened. The rightViewThreshold is always at half
...@@ -186,10 +186,10 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -186,10 +186,10 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
} }
/** /**
A SideNavigationControllerDelegate property used to bind A NavigationDrawerControllerDelegate property used to bind
the delegation object. the delegation object.
*/ */
public weak var delegate: SideNavigationControllerDelegate? public weak var delegate: NavigationDrawerControllerDelegate?
/** /**
A Boolean property used to enable and disable interactivity A Boolean property used to enable and disable interactivity
...@@ -380,7 +380,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -380,7 +380,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
@IBInspectable public private(set) var rightViewWidth: CGFloat! @IBInspectable public private(set) var rightViewWidth: CGFloat!
/** /**
An initializer for the SideNavigationController. An initializer for the NavigationDrawerController.
- Parameter rootViewController: The main UIViewController. - Parameter rootViewController: The main UIViewController.
- Parameter leftViewController: An Optional left UIViewController. - Parameter leftViewController: An Optional left UIViewController.
- Parameter rightViewController: An Optional right UIViewController. - Parameter rightViewController: An Optional right UIViewController.
...@@ -453,7 +453,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -453,7 +453,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
options: options, options: options,
animations: animations, animations: animations,
completion: { [weak self] (result: Bool) in completion: { [weak self] (result: Bool) in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
toViewController.didMoveToParentViewController(s) toViewController.didMoveToParentViewController(s)
s.rootViewController.removeFromParentViewController() s.rootViewController.removeFromParentViewController()
s.rootViewController = toViewController s.rootViewController = toViewController
...@@ -491,13 +491,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -491,13 +491,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if hide { if hide {
UIView.animateWithDuration(duration, UIView.animateWithDuration(duration,
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.bounds.size.width = width v.bounds.size.width = width
v.position.x = -width / 2 v.position.x = -width / 2
s.rootViewController.view.alpha = 1 s.rootViewController.view.alpha = 1
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.shadowPathAutoSizeEnabled = true v.shadowPathAutoSizeEnabled = true
s.layoutSubviews() s.layoutSubviews()
s.hideView(v) s.hideView(v)
...@@ -506,13 +506,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -506,13 +506,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
} else { } else {
UIView.animateWithDuration(duration, UIView.animateWithDuration(duration,
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.bounds.size.width = width v.bounds.size.width = width
v.position.x = width / 2 v.position.x = width / 2
s.rootViewController.view.alpha = 0.5 s.rootViewController.view.alpha = 0.5
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.shadowPathAutoSizeEnabled = true v.shadowPathAutoSizeEnabled = true
s.layoutSubviews() s.layoutSubviews()
s.showView(v) s.showView(v)
...@@ -565,13 +565,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -565,13 +565,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if hide { if hide {
UIView.animateWithDuration(duration, UIView.animateWithDuration(duration,
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.bounds.size.width = width v.bounds.size.width = width
v.position.x = s.view.bounds.width + width / 2 v.position.x = s.view.bounds.width + width / 2
s.rootViewController.view.alpha = 1 s.rootViewController.view.alpha = 1
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.shadowPathAutoSizeEnabled = true v.shadowPathAutoSizeEnabled = true
s.layoutSubviews() s.layoutSubviews()
s.hideView(v) s.hideView(v)
...@@ -580,13 +580,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -580,13 +580,13 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
} else { } else {
UIView.animateWithDuration(duration, UIView.animateWithDuration(duration,
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.bounds.size.width = width v.bounds.size.width = width
v.position.x = s.view.bounds.width - width / 2 v.position.x = s.view.bounds.width - width / 2
s.rootViewController.view.alpha = 0.5 s.rootViewController.view.alpha = 0.5
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.shadowPathAutoSizeEnabled = true v.shadowPathAutoSizeEnabled = true
s.layoutSubviews() s.layoutSubviews()
s.showView(v) s.showView(v)
...@@ -646,14 +646,14 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -646,14 +646,14 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
hideStatusBar() hideStatusBar()
showView(v) showView(v)
userInteractionEnabled = false userInteractionEnabled = false
delegate?.sideNavigationWillOpen?(self, position: .Left) delegate?.navigationDrawerWillOpen?(self, position: .Left)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { animations: {
v.position.x = v.width / 2 v.position.x = v.width / 2
self.rootViewController.view.alpha = 0.5 self.rootViewController.view.alpha = 0.5
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
s.delegate?.sideNavigationDidOpen?(s, position: .Left) s.delegate?.navigationDrawerDidOpen?(s, position: .Left)
} }
} }
} }
...@@ -672,16 +672,16 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -672,16 +672,16 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
hideStatusBar() hideStatusBar()
showView(v) showView(v)
userInteractionEnabled = false userInteractionEnabled = false
delegate?.sideNavigationWillOpen?(self, position: .Right) delegate?.navigationDrawerWillOpen?(self, position: .Right)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.position.x = s.view.bounds.width - v.width / 2 v.position.x = s.view.bounds.width - v.width / 2
s.rootViewController.view.alpha = 0.5 s.rootViewController.view.alpha = 0.5
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
s.delegate?.sideNavigationDidOpen?(s, position: .Right) s.delegate?.navigationDrawerDidOpen?(s, position: .Right)
} }
} }
} }
...@@ -698,18 +698,18 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -698,18 +698,18 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if enabledLeftView { if enabledLeftView {
if let v: MaterialView = leftView { if let v: MaterialView = leftView {
userInteractionEnabled = true userInteractionEnabled = true
delegate?.sideNavigationWillClose?(self, position: .Left) delegate?.navigationDrawerWillClose?(self, position: .Left)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.position.x = -v.width / 2 v.position.x = -v.width / 2
s.rootViewController.view.alpha = 1 s.rootViewController.view.alpha = 1
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
s.hideView(v) s.hideView(v)
s.toggleStatusBar() s.toggleStatusBar()
s.delegate?.sideNavigationDidClose?(s, position: .Left) s.delegate?.navigationDrawerDidClose?(s, position: .Left)
} }
} }
} }
...@@ -727,18 +727,18 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -727,18 +727,18 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if let v: MaterialView = rightView { if let v: MaterialView = rightView {
showStatusBar() showStatusBar()
userInteractionEnabled = true userInteractionEnabled = true
delegate?.sideNavigationWillClose?(self, position: .Right) delegate?.navigationDrawerWillClose?(self, position: .Right)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [weak self] in animations: { [weak self] in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
v.position.x = s.view.bounds.width + v.width / 2 v.position.x = s.view.bounds.width + v.width / 2
s.rootViewController.view.alpha = 1 s.rootViewController.view.alpha = 1
} }
}) { [weak self] _ in }) { [weak self] _ in
if let s: SideNavigationController = self { if let s: NavigationDrawerController = self {
s.hideView(v) s.hideView(v)
s.toggleStatusBar() s.toggleStatusBar()
s.delegate?.sideNavigationDidClose?(s, position: .Right) s.delegate?.navigationDrawerDidClose?(s, position: .Right)
} }
} }
} }
...@@ -783,7 +783,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -783,7 +783,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
case .Began: case .Began:
originalX = v.position.x originalX = v.position.x
showView(v) showView(v)
delegate?.sideNavigationPanDidBegin?(self, point: point, position: .Left) delegate?.navigationDrawerPanDidBegin?(self, point: point, position: .Left)
case .Changed: case .Changed:
let w: CGFloat = v.width let w: CGFloat = v.width
let translationX: CGFloat = recognizer.translationInView(v).x let translationX: CGFloat = recognizer.translationInView(v).x
...@@ -797,12 +797,12 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -797,12 +797,12 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
hideStatusBar() hideStatusBar()
} }
delegate?.sideNavigationPanDidChange?(self, point: point, position: .Left) delegate?.navigationDrawerPanDidChange?(self, point: point, position: .Left)
case .Ended, .Cancelled, .Failed: case .Ended, .Cancelled, .Failed:
let p: CGPoint = recognizer.velocityInView(recognizer.view) let p: CGPoint = recognizer.velocityInView(recognizer.view)
let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0 let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0
delegate?.sideNavigationPanDidEnd?(self, point: point, position: .Left) delegate?.navigationDrawerPanDidEnd?(self, point: point, position: .Left)
if v.x <= -leftViewWidth + leftViewThreshold || x < -1000 { if v.x <= -leftViewWidth + leftViewThreshold || x < -1000 {
closeLeftView(x) closeLeftView(x)
...@@ -831,7 +831,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -831,7 +831,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
case .Began: case .Began:
originalX = v.position.x originalX = v.position.x
showView(v) showView(v)
delegate?.sideNavigationPanDidBegin?(self, point: point, position: .Right) delegate?.navigationDrawerPanDidBegin?(self, point: point, position: .Right)
case .Changed: case .Changed:
let w: CGFloat = v.width let w: CGFloat = v.width
let translationX: CGFloat = recognizer.translationInView(v).x let translationX: CGFloat = recognizer.translationInView(v).x
...@@ -845,12 +845,12 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -845,12 +845,12 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
hideStatusBar() hideStatusBar()
} }
delegate?.sideNavigationPanDidChange?(self, point: point, position: .Right) delegate?.navigationDrawerPanDidChange?(self, point: point, position: .Right)
case .Ended, .Cancelled, .Failed: case .Ended, .Cancelled, .Failed:
let p: CGPoint = recognizer.velocityInView(recognizer.view) let p: CGPoint = recognizer.velocityInView(recognizer.view)
let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0 let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0
delegate?.sideNavigationPanDidEnd?(self, point: point, position: .Right) delegate?.navigationDrawerPanDidEnd?(self, point: point, position: .Right)
if v.x >= rightViewThreshold || x > 1000 { if v.x >= rightViewThreshold || x > 1000 {
closeRightView(x) closeRightView(x)
...@@ -872,7 +872,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -872,7 +872,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
internal func handleLeftViewTapGesture(recognizer: UITapGestureRecognizer) { internal func handleLeftViewTapGesture(recognizer: UITapGestureRecognizer) {
if openedLeftView { if openedLeftView {
if let v: MaterialView = leftView { if let v: MaterialView = leftView {
delegate?.sideNavigationDidTap?(self, point: recognizer.locationInView(view), position: .Left) delegate?.navigationDrawerDidTap?(self, point: recognizer.locationInView(view), position: .Left)
if enabledLeftView && openedLeftView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) { if enabledLeftView && openedLeftView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) {
closeLeftView() closeLeftView()
} }
...@@ -889,7 +889,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -889,7 +889,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
internal func handleRightViewTapGesture(recognizer: UITapGestureRecognizer) { internal func handleRightViewTapGesture(recognizer: UITapGestureRecognizer) {
if openedRightView { if openedRightView {
if let v: MaterialView = rightView { if let v: MaterialView = rightView {
delegate?.sideNavigationDidTap?(self, point: recognizer.locationInView(view), position: .Right) delegate?.navigationDrawerDidTap?(self, point: recognizer.locationInView(view), position: .Right)
if enabledRightView && openedRightView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) { if enabledRightView && openedRightView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) {
closeRightView() closeRightView()
} }
...@@ -982,7 +982,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -982,7 +982,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/** /**
A method that adds the passed in controller as a child of A method that adds the passed in controller as a child of
the SideNavigationController within the passed in the NavigationDrawerController within the passed in
container view. container view.
- Parameter viewController: A UIViewController to add as a child. - Parameter viewController: A UIViewController to add as a child.
- Parameter container: A UIView that is the parent of the - Parameter container: A UIView that is the parent of the
...@@ -1101,7 +1101,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -1101,7 +1101,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
self?.setNeedsStatusBarAppearanceUpdate() self?.setNeedsStatusBarAppearanceUpdate()
self?.statusBarHidden = false self?.statusBarHidden = false
}) })
delegate?.sideNavigationStatusBarHiddenState?(self, hidden: false) delegate?.navigationDrawerStatusBarHiddenState?(self, hidden: false)
} }
} }
...@@ -1115,7 +1115,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -1115,7 +1115,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
self?.setNeedsStatusBarAppearanceUpdate() self?.setNeedsStatusBarAppearanceUpdate()
self?.statusBarHidden = true self?.statusBarHidden = true
}) })
delegate?.sideNavigationStatusBarHiddenState?(self, hidden: true) delegate?.navigationDrawerStatusBarHiddenState?(self, hidden: true)
} }
} }
} }
...@@ -1132,7 +1132,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -1132,7 +1132,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/** /**
A method that determines whether the passed point is A method that determines whether the passed point is
contained within the bounds of the leftViewThreshold contained within the bounds of the leftViewThreshold
and height of the SideNavigationController view frame and height of the NavigationDrawerController view frame
property. property.
- Parameter point: A CGPoint to test against. - Parameter point: A CGPoint to test against.
- Returns: A Boolean of the result, true if yes, false - Returns: A Boolean of the result, true if yes, false
...@@ -1145,7 +1145,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -1145,7 +1145,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/** /**
A method that determines whether the passed point is A method that determines whether the passed point is
contained within the bounds of the rightViewThreshold contained within the bounds of the rightViewThreshold
and height of the SideNavigationController view frame and height of the NavigationDrawerController view frame
property. property.
- Parameter point: A CGPoint to test against. - Parameter point: A CGPoint to test against.
- Returns: A Boolean of the result, true if yes, false - Returns: A Boolean of the result, true if yes, false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment