Commit 8b1fc4de by Daniel Dahan

updated SideNavigationController to NavigationDrawerController

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