Commit e69ba269 by Daniel Dahan

removed NavigationBarView* code

parent 4129092d
......@@ -47,12 +47,6 @@
location = "group:Programmatic/MenuViewController/MenuViewController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/NavigationBarView/NavigationBarView.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/NavigationBarViewController/NavigationBarViewController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/SearchBarView/SearchBarView.xcodeproj">
</FileRef>
<FileRef
......@@ -87,9 +81,6 @@
location = "group:Storyboards/MaterialButton/MaterialButton.xcodeproj">
</FileRef>
<FileRef
location = "group:Storyboards/NavigationBarView/NavigationBarView.xcodeproj">
</FileRef>
<FileRef
location = "group:Storyboards/SideNavigationViewController/SideNavigationViewController.xcodeproj">
</FileRef>
<FileRef
......
......@@ -40,7 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
// window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationBarViewController(mainViewController: InboxViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationController(rootViewController: FeedViewController())), leftViewController: AppLeftViewController())
window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationController(rootViewController: FeedViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
window!.makeKeyAndVisible()
return true
}
......
......@@ -158,31 +158,4 @@ extension AppLeftViewController: UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
print("Cell selected")
}
func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
let item: Item = items[indexPath.row]
print(sideNavigationViewController?.mainViewController.navigationController)
/**
An example of loading a new UIViewController in the AppNavigationBarViewController
if the UIViewController is not already loaded. This is a bit of a tricky example, as
we are diving deeper into the view hierarchy to transition only the mainViewController of the
AppNavigationBarViewController.
Accessing the mainViewController of: SideNavigationViewController -> MenuViewController -> NavigationBarViewController.
*/
if let a: MenuViewController = sideNavigationViewController?.mainViewController as? MenuViewController {
if let b: NavigationBarViewController = a.mainViewController as? NavigationBarViewController {
if "Feed" == item.text && !(b.mainViewController is FeedViewController) {
b.transitionFromMainViewController(FeedViewController(), options: [.TransitionCrossDissolve]) { [weak self] _ in
self?.sideNavigationViewController?.closeLeftView()
}
} else if "Inbox" == item.text && !(b.mainViewController is InboxViewController) {
b.transitionFromMainViewController(InboxViewController(), options: [.TransitionCrossDissolve]) { [weak self] _ in
self?.sideNavigationViewController?.closeLeftView()
}
}
}
}
return indexPath
}
}
......@@ -58,12 +58,13 @@ class AppSearchBarViewController: SearchBarViewController {
/// Toggle SideSearchViewController left UIViewController.
internal func handleBackButton() {
searchBarView.textField.resignFirstResponder()
navigationBarViewController?.floatingViewController = nil
dismissViewControllerAnimated(true, completion: nil)
}
/// Toggle SideSearchViewController right UIViewController.
internal func handleMoreButton() {
searchBarView.textField.resignFirstResponder()
print(presentingViewController?.view.layer.zPosition)
sideNavigationViewController?.enabledRightView = true
sideNavigationViewController?.toggleRightView()
}
......
......@@ -66,7 +66,7 @@ class FeedViewController: UIViewController {
/// Handler for searchButton.
internal func handleSearchButton() {
print("handled")
presentViewController(AppSearchBarViewController(mainViewController: SearchListViewController()), animated: true, completion: nil)
}
/// Prepares view.
......
......@@ -125,7 +125,7 @@ extension SearchListViewController: UITableViewDataSource {
header.addSubview(label)
label.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(header, child: label, left: navigationBarViewController!.navigationBarView.contentInset.left + navigationBarViewController!.navigationBarView.spacing)
MaterialLayout.alignToParent(header, child: label, left: 24)
return header
}
......
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
96D88C831C132C1800B91418 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C821C132C1800B91418 /* AppDelegate.swift */; };
96D88C851C132C1800B91418 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C841C132C1800B91418 /* ViewController.swift */; };
96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C891C132C1800B91418 /* Assets.xcassets */; };
96D88C8D1C132C1800B91418 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C8B1C132C1800B91418 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
96D88C971C132C7800B91418 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96D88C7F1C132C1800B91418 /* NavigationBarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarView.app; sourceTree = BUILT_PRODUCTS_DIR; };
96D88C821C132C1800B91418 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96D88C841C132C1800B91418 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
96D88C891C132C1800B91418 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96D88C8C1C132C1800B91418 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96D88C8E1C132C1900B91418 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
96D88C7C1C132C1800B91418 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
96D88C761C132C1800B91418 = {
isa = PBXGroup;
children = (
96D88C811C132C1800B91418 /* NavigationBarView */,
96D88C801C132C1800B91418 /* Products */,
);
sourceTree = "<group>";
};
96D88C801C132C1800B91418 /* Products */ = {
isa = PBXGroup;
children = (
96D88C7F1C132C1800B91418 /* NavigationBarView.app */,
);
name = Products;
sourceTree = "<group>";
};
96D88C811C132C1800B91418 /* NavigationBarView */ = {
isa = PBXGroup;
children = (
96D88C821C132C1800B91418 /* AppDelegate.swift */,
96D88C841C132C1800B91418 /* ViewController.swift */,
96D88C891C132C1800B91418 /* Assets.xcassets */,
96D88C8B1C132C1800B91418 /* LaunchScreen.storyboard */,
96D88C8E1C132C1900B91418 /* Info.plist */,
);
path = NavigationBarView;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96D88C7E1C132C1800B91418 /* NavigationBarView */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96D88C911C132C1900B91418 /* Build configuration list for PBXNativeTarget "NavigationBarView" */;
buildPhases = (
96D88C7B1C132C1800B91418 /* Sources */,
96D88C7C1C132C1800B91418 /* Frameworks */,
96D88C7D1C132C1800B91418 /* Resources */,
96D88C971C132C7800B91418 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NavigationBarView;
productName = NavigationBarView;
productReference = 96D88C7F1C132C1800B91418 /* NavigationBarView.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
96D88C771C132C1800B91418 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = {
96D88C7E1C132C1800B91418 = {
CreatedOnToolsVersion = 7.1.1;
};
};
};
buildConfigurationList = 96D88C7A1C132C1800B91418 /* Build configuration list for PBXProject "NavigationBarView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 96D88C761C132C1800B91418;
productRefGroup = 96D88C801C132C1800B91418 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
96D88C7E1C132C1800B91418 /* NavigationBarView */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
96D88C7D1C132C1800B91418 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96D88C8D1C132C1800B91418 /* LaunchScreen.storyboard in Resources */,
96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
96D88C7B1C132C1800B91418 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96D88C851C132C1800B91418 /* ViewController.swift in Sources */,
96D88C831C132C1800B91418 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96D88C8B1C132C1800B91418 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96D88C8C1C132C1800B91418 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
96D88C8F1C132C1900B91418 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
96D88C901C132C1900B91418 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
96D88C921C132C1900B91418 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarView;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
96D88C931C132C1900B91418 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarView;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96D88C7A1C132C1800B91418 /* Build configuration list for PBXProject "NavigationBarView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96D88C8F1C132C1900B91418 /* Debug */,
96D88C901C132C1900B91418 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96D88C911C132C1900B91418 /* Build configuration list for PBXNativeTarget "NavigationBarView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96D88C921C132C1900B91418 /* Debug */,
96D88C931C132C1900B91418 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 96D88C771C132C1800B91418 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:NavigationBarView.xcodeproj">
</FileRef>
</Workspace>
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
9600361B1C7828BB00EBA579 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9600361A1C7828BB00EBA579 /* BlueViewController.swift */; };
9600361D1C7829EF00EBA579 /* GreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9600361C1C7829EF00EBA579 /* GreenViewController.swift */; };
96A71FC41C765FDF00C0C4AE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FC31C765FDF00C0C4AE /* AppDelegate.swift */; };
96A71FC61C765FDF00C0C4AE /* AppNavigationBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FC51C765FDF00C0C4AE /* AppNavigationBarViewController.swift */; };
96A71FCB1C765FDF00C0C4AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96A71FCA1C765FDF00C0C4AE /* Assets.xcassets */; };
96A71FCE1C765FDF00C0C4AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96A71FCC1C765FDF00C0C4AE /* LaunchScreen.storyboard */; };
96A71FD61C76618D00C0C4AE /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FD51C76618D00C0C4AE /* YellowViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
96A71FDA1C7661D200C0C4AE /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9600361A1C7828BB00EBA579 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; };
9600361C1C7829EF00EBA579 /* GreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewController.swift; sourceTree = "<group>"; };
96A71FC01C765FDF00C0C4AE /* NavigationBarViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarViewController.app; sourceTree = BUILT_PRODUCTS_DIR; };
96A71FC31C765FDF00C0C4AE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96A71FC51C765FDF00C0C4AE /* AppNavigationBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppNavigationBarViewController.swift; sourceTree = "<group>"; };
96A71FCA1C765FDF00C0C4AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96A71FCD1C765FDF00C0C4AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96A71FCF1C765FDF00C0C4AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96A71FD51C76618D00C0C4AE /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
96A71FBD1C765FDF00C0C4AE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
96A71FB71C765FDF00C0C4AE = {
isa = PBXGroup;
children = (
96A71FC21C765FDF00C0C4AE /* NavigationBarViewController */,
96A71FC11C765FDF00C0C4AE /* Products */,
);
sourceTree = "<group>";
};
96A71FC11C765FDF00C0C4AE /* Products */ = {
isa = PBXGroup;
children = (
96A71FC01C765FDF00C0C4AE /* NavigationBarViewController.app */,
);
name = Products;
sourceTree = "<group>";
};
96A71FC21C765FDF00C0C4AE /* NavigationBarViewController */ = {
isa = PBXGroup;
children = (
96A71FC31C765FDF00C0C4AE /* AppDelegate.swift */,
96A71FC51C765FDF00C0C4AE /* AppNavigationBarViewController.swift */,
96A71FD51C76618D00C0C4AE /* YellowViewController.swift */,
9600361A1C7828BB00EBA579 /* BlueViewController.swift */,
9600361C1C7829EF00EBA579 /* GreenViewController.swift */,
96A71FCA1C765FDF00C0C4AE /* Assets.xcassets */,
96A71FCC1C765FDF00C0C4AE /* LaunchScreen.storyboard */,
96A71FCF1C765FDF00C0C4AE /* Info.plist */,
);
path = NavigationBarViewController;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96A71FBF1C765FDF00C0C4AE /* NavigationBarViewController */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96A71FD21C765FDF00C0C4AE /* Build configuration list for PBXNativeTarget "NavigationBarViewController" */;
buildPhases = (
96A71FBC1C765FDF00C0C4AE /* Sources */,
96A71FBD1C765FDF00C0C4AE /* Frameworks */,
96A71FBE1C765FDF00C0C4AE /* Resources */,
96A71FDA1C7661D200C0C4AE /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NavigationBarViewController;
productName = NavigationBarViewController;
productReference = 96A71FC01C765FDF00C0C4AE /* NavigationBarViewController.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
96A71FB81C765FDF00C0C4AE /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = {
96A71FBF1C765FDF00C0C4AE = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = 96A71FBB1C765FDF00C0C4AE /* Build configuration list for PBXProject "NavigationBarViewController" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 96A71FB71C765FDF00C0C4AE;
productRefGroup = 96A71FC11C765FDF00C0C4AE /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
96A71FBF1C765FDF00C0C4AE /* NavigationBarViewController */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
96A71FBE1C765FDF00C0C4AE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96A71FCE1C765FDF00C0C4AE /* LaunchScreen.storyboard in Resources */,
96A71FCB1C765FDF00C0C4AE /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
96A71FBC1C765FDF00C0C4AE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9600361B1C7828BB00EBA579 /* BlueViewController.swift in Sources */,
96A71FD61C76618D00C0C4AE /* YellowViewController.swift in Sources */,
9600361D1C7829EF00EBA579 /* GreenViewController.swift in Sources */,
96A71FC61C765FDF00C0C4AE /* AppNavigationBarViewController.swift in Sources */,
96A71FC41C765FDF00C0C4AE /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96A71FCC1C765FDF00C0C4AE /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96A71FCD1C765FDF00C0C4AE /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
96A71FD01C765FDF00C0C4AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
96A71FD11C765FDF00C0C4AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
96A71FD31C765FDF00C0C4AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarViewController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
96A71FD41C765FDF00C0C4AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarViewController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96A71FBB1C765FDF00C0C4AE /* Build configuration list for PBXProject "NavigationBarViewController" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96A71FD01C765FDF00C0C4AE /* Debug */,
96A71FD11C765FDF00C0C4AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96A71FD21C765FDF00C0C4AE /* Build configuration list for PBXNativeTarget "NavigationBarViewController" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96A71FD31C765FDF00C0C4AE /* Debug */,
96A71FD41C765FDF00C0C4AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 96A71FB81C765FDF00C0C4AE /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:NavigationBarViewController.xcodeproj">
</FileRef>
</Workspace>
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
9ABEC5151C15085400F6895E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEC5141C15085400F6895E /* AppDelegate.swift */; };
9ABEC5171C15085400F6895E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEC5161C15085400F6895E /* ViewController.swift */; };
9ABEC51A1C15085400F6895E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9ABEC5181C15085400F6895E /* Main.storyboard */; };
9ABEC51C1C15085400F6895E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9ABEC51B1C15085400F6895E /* Assets.xcassets */; };
9ABEC51F1C15085400F6895E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9ABEC51D1C15085400F6895E /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9ABEC5291C15092900F6895E /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9ABEC5111C15085400F6895E /* NavigationBarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarView.app; sourceTree = BUILT_PRODUCTS_DIR; };
9ABEC5141C15085400F6895E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9ABEC5161C15085400F6895E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
9ABEC5191C15085400F6895E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
9ABEC51B1C15085400F6895E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9ABEC51E1C15085400F6895E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9ABEC5201C15085400F6895E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
9ABEC50E1C15085400F6895E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9ABEC5081C15085400F6895E = {
isa = PBXGroup;
children = (
9ABEC5131C15085400F6895E /* NavigationBarView */,
9ABEC5121C15085400F6895E /* Products */,
);
sourceTree = "<group>";
};
9ABEC5121C15085400F6895E /* Products */ = {
isa = PBXGroup;
children = (
9ABEC5111C15085400F6895E /* NavigationBarView.app */,
);
name = Products;
sourceTree = "<group>";
};
9ABEC5131C15085400F6895E /* NavigationBarView */ = {
isa = PBXGroup;
children = (
9ABEC5141C15085400F6895E /* AppDelegate.swift */,
9ABEC5161C15085400F6895E /* ViewController.swift */,
9ABEC5181C15085400F6895E /* Main.storyboard */,
9ABEC51B1C15085400F6895E /* Assets.xcassets */,
9ABEC51D1C15085400F6895E /* LaunchScreen.storyboard */,
9ABEC5201C15085400F6895E /* Info.plist */,
);
path = NavigationBarView;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
9ABEC5101C15085400F6895E /* NavigationBarView */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9ABEC5231C15085400F6895E /* Build configuration list for PBXNativeTarget "NavigationBarView" */;
buildPhases = (
9ABEC50D1C15085400F6895E /* Sources */,
9ABEC50E1C15085400F6895E /* Frameworks */,
9ABEC50F1C15085400F6895E /* Resources */,
9ABEC5291C15092900F6895E /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NavigationBarView;
productName = NavigationBarView;
productReference = 9ABEC5111C15085400F6895E /* NavigationBarView.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
9ABEC5091C15085400F6895E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "Adam Dahan";
TargetAttributes = {
9ABEC5101C15085400F6895E = {
CreatedOnToolsVersion = 7.1.1;
};
};
};
buildConfigurationList = 9ABEC50C1C15085400F6895E /* Build configuration list for PBXProject "NavigationBarView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 9ABEC5081C15085400F6895E;
productRefGroup = 9ABEC5121C15085400F6895E /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
9ABEC5101C15085400F6895E /* NavigationBarView */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
9ABEC50F1C15085400F6895E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9ABEC51F1C15085400F6895E /* LaunchScreen.storyboard in Resources */,
9ABEC51C1C15085400F6895E /* Assets.xcassets in Resources */,
9ABEC51A1C15085400F6895E /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
9ABEC50D1C15085400F6895E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9ABEC5171C15085400F6895E /* ViewController.swift in Sources */,
9ABEC5151C15085400F6895E /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
9ABEC5181C15085400F6895E /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
9ABEC5191C15085400F6895E /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
9ABEC51D1C15085400F6895E /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
9ABEC51E1C15085400F6895E /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
9ABEC5211C15085400F6895E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
9ABEC5221C15085400F6895E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
9ABEC5241C15085400F6895E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarView;
PRODUCT_NAME = NavigationBarView;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
9ABEC5251C15085400F6895E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarView;
PRODUCT_NAME = NavigationBarView;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
9ABEC50C1C15085400F6895E /* Build configuration list for PBXProject "NavigationBarView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9ABEC5211C15085400F6895E /* Debug */,
9ABEC5221C15085400F6895E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9ABEC5231C15085400F6895E /* Build configuration list for PBXNativeTarget "NavigationBarView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9ABEC5241C15085400F6895E /* Debug */,
9ABEC5251C15085400F6895E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 9ABEC5091C15085400F6895E /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Storyboards/NavigationBarView/NavigationBarView.xcodeproj">
</FileRef>
</Workspace>
......@@ -57,7 +57,6 @@
96A71EBB1C6FCFA300C0C4AE /* MenuView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */; };
96A71EF61C71127100C0C4AE /* SearchBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EF51C71127100C0C4AE /* SearchBarView.swift */; };
96A71F301C72E41100C0C4AE /* NavigationBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */; };
96A71F451C74ABCB00C0C4AE /* MaterialBorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F441C74ABCB00C0C4AE /* MaterialBorder.swift */; };
96A71FB31C764E3200C0C4AE /* StatusBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */; };
96A71FB61C7651AA00C0C4AE /* ControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FB01C7649F800C0C4AE /* ControlView.swift */; };
......@@ -68,7 +67,6 @@
96CC08351C7CCB7C0034FF84 /* StatusBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08361C7CCB7C0034FF84 /* SearchBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71EF51C71127100C0C4AE /* SearchBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08371C7CCB7C0034FF84 /* SearchBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960036141C77E1B600EBA579 /* SearchBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08381C7CCB7C0034FF84 /* NavigationBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC083D1C7CF9D40034FF84 /* StatusBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC083C1C7CF9D40034FF84 /* StatusBarViewController.swift */; };
96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC083C1C7CF9D40034FF84 /* StatusBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08921C7FEC170034FF84 /* MaterialCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC088B1C7FEC170034FF84 /* MaterialCollectionView.swift */; };
......@@ -105,7 +103,6 @@
96D88C3A1C1328D800B91418 /* MaterialTextLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C111C1328D800B91418 /* MaterialTextLayer.swift */; };
96D88C3C1C1328D800B91418 /* MaterialTransitionAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C131C1328D800B91418 /* MaterialTransitionAnimation.swift */; };
96D88C3D1C1328D800B91418 /* MaterialView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C141C1328D800B91418 /* MaterialView.swift */; };
96D88C3E1C1328D800B91418 /* NavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C151C1328D800B91418 /* NavigationBarView.swift */; };
96D88C3F1C1328D800B91418 /* RaisedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C161C1328D800B91418 /* RaisedButton.swift */; };
96D88C401C1328D800B91418 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C171C1328D800B91418 /* Roboto-Bold.ttf */; };
96D88C411C1328D800B91418 /* Roboto-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C181C1328D800B91418 /* Roboto-Light.ttf */; };
......@@ -143,7 +140,6 @@
96D88C721C132ACC00B91418 /* MaterialTransitionAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C131C1328D800B91418 /* MaterialTransitionAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C731C132ACC00B91418 /* MaterialAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88BFF1C1328D800B91418 /* MaterialAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C741C132ACC00B91418 /* MaterialBasicAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C001C1328D800B91418 /* MaterialBasicAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C751C132AD500B91418 /* NavigationBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C151C1328D800B91418 /* NavigationBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96DBA7361C61198400844821 /* Material+UIImage+Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96DBA7351C61198400844821 /* Material+UIImage+Color.swift */; };
/* End PBXBuildFile section */
......@@ -186,7 +182,6 @@
96A71E901C6FBC2200C0C4AE /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = "<group>"; };
96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialSwitch.swift; sourceTree = "<group>"; };
96A71EF51C71127100C0C4AE /* SearchBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarView.swift; sourceTree = "<group>"; };
96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationBarViewController.swift; sourceTree = "<group>"; };
96A71F441C74ABCB00C0C4AE /* MaterialBorder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialBorder.swift; sourceTree = "<group>"; };
96A71FB01C7649F800C0C4AE /* ControlView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlView.swift; sourceTree = "<group>"; };
96A71FB21C764E3200C0C4AE /* StatusBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusBarView.swift; sourceTree = "<group>"; };
......@@ -227,7 +222,6 @@
96D88C111C1328D800B91418 /* MaterialTextLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialTextLayer.swift; sourceTree = "<group>"; };
96D88C131C1328D800B91418 /* MaterialTransitionAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialTransitionAnimation.swift; sourceTree = "<group>"; };
96D88C141C1328D800B91418 /* MaterialView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialView.swift; sourceTree = "<group>"; };
96D88C151C1328D800B91418 /* NavigationBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationBarView.swift; sourceTree = "<group>"; };
96D88C161C1328D800B91418 /* RaisedButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RaisedButton.swift; sourceTree = "<group>"; };
96D88C171C1328D800B91418 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Bold.ttf"; sourceTree = "<group>"; };
96D88C181C1328D800B91418 /* Roboto-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Light.ttf"; sourceTree = "<group>"; };
......@@ -261,8 +255,6 @@
9626C2DA1C794FA5007CA8E0 /* NavigationBar */ = {
isa = PBXGroup;
children = (
96D88C151C1328D800B91418 /* NavigationBarView.swift */,
96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */,
96334EF71C8B84880083986B /* NavigationBar.swift */,
96334EF91C8B849A0083986B /* NavigationController.swift */,
);
......@@ -566,7 +558,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
96D88C751C132AD500B91418 /* NavigationBarView.swift in Headers */,
96D88C661C132ACB00B91418 /* SideNavigationViewController.swift in Headers */,
96D88C671C132ACB00B91418 /* MaterialPulseView.swift in Headers */,
96D88C681C132ACB00B91418 /* MaterialView.swift in Headers */,
......@@ -620,7 +611,6 @@
96CC08351C7CCB7C0034FF84 /* StatusBarView.swift in Headers */,
96CC08361C7CCB7C0034FF84 /* SearchBarView.swift in Headers */,
96CC08371C7CCB7C0034FF84 /* SearchBarViewController.swift in Headers */,
96CC08381C7CCB7C0034FF84 /* NavigationBarViewController.swift in Headers */,
96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */,
965626431C8757B4004ADEF7 /* MaterialSpacing.swift in Headers */,
965626441C8757B4004ADEF7 /* MaterialDevice.swift in Headers */,
......@@ -765,7 +755,6 @@
96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */,
96CC08951C7FEC170034FF84 /* MaterialCollectionViewDelegate.swift in Sources */,
96CC08971C7FEC170034FF84 /* MaterialDataSourceItem.swift in Sources */,
96D88C3E1C1328D800B91418 /* NavigationBarView.swift in Sources */,
96D88C221C1328D800B91418 /* FabButton.swift in Sources */,
96D88C3F1C1328D800B91418 /* RaisedButton.swift in Sources */,
65FDC2EB1C66858A00103AC2 /* Menu.swift in Sources */,
......@@ -779,7 +768,6 @@
96CC08941C7FEC170034FF84 /* MaterialCollectionViewDataSource.swift in Sources */,
96D88C331C1328D800B91418 /* MaterialLabel.swift in Sources */,
96D88C281C1328D800B91418 /* MaterialAnimation.swift in Sources */,
96A71F301C72E41100C0C4AE /* NavigationBarViewController.swift in Sources */,
96334F011C8B8BD30083986B /* Material+UIImage+Blank.swift in Sources */,
960B232E1C383EAA00E96216 /* Material+UIImage.swift in Sources */,
96334F031C8BA14C0083986B /* Material+Obj-C.swift in Sources */,
......
......@@ -30,6 +30,18 @@
import UIKit
public extension UINavigationBar {
/// Device status bar style.
public var statusBarStyle: UIStatusBarStyle {
get {
return MaterialDevice.statusBarStyle
}
set(value) {
MaterialDevice.statusBarStyle = value
}
}
}
public class NavigationBar : UINavigationBar {
/// Reference to the backButton.
public private(set) lazy var backButton: FlatButton = FlatButton()
......@@ -233,27 +245,6 @@ public class NavigationBar : UINavigationBar {
}
}
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false {
didSet {
if shadowPathAutoSizeEnabled {
layoutShadowPath()
} else {
shadowPath = nil
}
}
}
/**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth
......@@ -265,7 +256,6 @@ public class NavigationBar : UINavigationBar {
shadowOffset = value.offset
shadowOpacity = value.opacity
shadowRadius = value.radius
layoutShadowPath()
}
}
......@@ -285,7 +275,6 @@ public class NavigationBar : UINavigationBar {
}
set(value) {
layer.cornerRadius = value
layoutShadowPath()
}
}
......@@ -368,12 +357,16 @@ public class NavigationBar : UINavigationBar {
super.layoutSublayersOfLayer(layer)
if self.layer == layer {
layoutVisualLayer()
layoutShadowPath()
}
}
public override func layoutSubviews() {
super.layoutSubviews()
/*
When rotating the device orientation, this adjusts the layout
of the titleView subviews.
*/
topItem?.titleView?.grid.reloadLayout()
}
......@@ -392,7 +385,7 @@ public class NavigationBar : UINavigationBar {
}
if nil == item.titleView {
item.titleView = UIView(frame: CGRectMake(0, 2, 2000, 40))
item.titleView = UIView(frame: CGRectMake(0, 0, 2000, 44))
item.titleView!.backgroundColor = nil
item.titleView!.grid.axis.direction = .Vertical
}
......@@ -402,9 +395,11 @@ public class NavigationBar : UINavigationBar {
// TitleView alignment.
if let t: UILabel = item.titleLabel {
t.grid.rows = 1
t.backgroundColor = MaterialColor.red.accent1
item.titleView!.addSubview(t)
item.titleView!.grid.views?.append(t)
if let d: UILabel = item.detailLabel {
d.backgroundColor = MaterialColor.red.accent3
t.font = t.font.fontWithSize(17)
d.grid.rows = 1
d.font = d.font.fontWithSize(12)
......@@ -446,8 +441,6 @@ public class NavigationBar : UINavigationBar {
backButtonImage = nil
backgroundColor = MaterialColor.white
depth = .Depth1
spacingPreset = .Spacing2
contentInset = UIEdgeInsetsMake(8, 0, 8, 0)
prepareVisualLayer()
prepareBackButton()
}
......@@ -472,168 +465,88 @@ public class NavigationBar : UINavigationBar {
backButton.setImage(backButtonImage, forState: .Normal)
backButton.setImage(backButtonImage, forState: .Highlighted)
}
/// Sets the shadow path.
internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == depth {
shadowPath = nil
} else if nil == shadowPath {
shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
}
}
}
}
/// A memory reference to the NavigationBarControls instance for UINavigationBar extensions.
private var NavigationItemControlsKey: UInt8 = 0
/// A memory reference to the NavigationItem instance for UINavigationBar extensions.
private var NavigationItemKey: UInt8 = 0
public class NavigationItemControls {
public class NavigationItem {
/// Inset.
public var inset: CGFloat = -16
/// Left controls.
public var leftControls: Array<UIControl>?
/// Right controls.
public var rightControls: Array<UIControl>?
}
/// A memory reference to the NavigationItemLabels instance for UINavigationItem extensions.
private var NavigationItemLabelsKey: UInt8 = 0
public class NavigationItemLabels {
/// Title label.
public var titleLabel: UILabel?
/// Detail label.
public var detailLabel: UILabel?
/// Left controls.
public var leftControls: Array<UIControl>?
/// Right controls.
public var rightControls: Array<UIControl>?
}
public extension UINavigationItem {
/// NavigationBarControls reference.
public internal(set) var labels: NavigationItemLabels {
public internal(set) var item: NavigationItem {
get {
return MaterialAssociatedObject(self, key: &NavigationItemLabelsKey) {
return NavigationItemLabels()
return MaterialAssociatedObject(self, key: &NavigationItemKey) {
return NavigationItem()
}
}
set(value) {
MaterialAssociateObject(self, key: &NavigationItemLabelsKey, value: value)
MaterialAssociateObject(self, key: &NavigationItemKey, value: value)
}
}
/// Title Label.
public var titleLabel: UILabel? {
get {
return labels.titleLabel
}
set(value) {
labels.titleLabel = value
}
}
/// Detail Label.
public var detailLabel: UILabel? {
/// Inset.
public var inset: CGFloat {
get {
return labels.detailLabel
return item.inset
}
set(value) {
labels.detailLabel = value
item.inset = value
}
}
/// NavigationBarControls reference.
public internal(set) var controls: NavigationItemControls {
/// Title Label.
public var titleLabel: UILabel? {
get {
return MaterialAssociatedObject(self, key: &NavigationItemControlsKey) {
return NavigationItemControls()
}
return item.titleLabel
}
set(value) {
MaterialAssociateObject(self, key: &NavigationItemControlsKey, value: value)
item.titleLabel = value
}
}
/// Inset.
public var inset: CGFloat {
/// Detail Label.
public var detailLabel: UILabel? {
get {
return controls.inset
return item.detailLabel
}
set(value) {
controls.inset = value
item.detailLabel = value
}
}
/// Left side UIControls.
public var leftControls: Array<UIControl>? {
get {
return controls.leftControls
return item.leftControls
}
set(value) {
controls.leftControls = value
item.leftControls = value
}
}
/// Right side UIControls.
public var rightControls: Array<UIControl>? {
get {
return controls.rightControls
}
set(value) {
controls.rightControls = value
}
}
}
public extension UINavigationBar {
/// Device status bar style.
public var statusBarStyle: UIStatusBarStyle {
get {
return MaterialDevice.statusBarStyle
}
set(value) {
MaterialDevice.statusBarStyle = value
}
}
/// A preset wrapper around contentInset.
public var contentInsetPreset: MaterialEdgeInset {
get {
return grid.contentInsetPreset
}
set(value) {
grid.contentInsetPreset = value
}
}
/// A wrapper around grid.contentInset.
public var contentInset: UIEdgeInsets {
get {
return grid.contentInset
}
set(value) {
grid.contentInset = value
}
}
/// A preset wrapper around spacing.
public var spacingPreset: MaterialSpacing {
get {
return grid.spacingPreset
}
set(value) {
grid.spacingPreset = value
}
}
/// A wrapper around grid.spacing.
public var spacing: CGFloat {
get {
return grid.spacing
return item.rightControls
}
set(value) {
grid.spacing = value
item.rightControls = value
}
}
}
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public class NavigationBarView : StatusBarView {
/// Title label.
public var titleLabel: UILabel? {
didSet {
if let v: UILabel = titleLabel {
contentView.addSubview(v)
}
layoutSubviews()
}
}
/// Detail label.
public var detailLabel: UILabel? {
didSet {
if let v: UILabel = detailLabel {
contentView.addSubview(v)
}
layoutSubviews()
}
}
/// A convenience initializer.
public convenience init() {
self.init(frame: CGRectZero)
}
/**
A convenience initializer with parameter settings.
- Parameter titleLabel: UILabel for the title.
- Parameter detailLabel: UILabel for the details.
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
self.init(frame: CGRectZero)
prepareProperties(titleLabel, detailLabel: detailLabel, leftControls: leftControls, rightControls: rightControls)
}
public override func layoutSubviews() {
super.layoutSubviews()
if willRenderView {
// TitleView alignment.
if let v: UILabel = titleLabel {
if let d: UILabel = detailLabel {
v.grid.rows = 2
v.font = v.font.fontWithSize(17)
d.grid.rows = 2
d.font = d.font.fontWithSize(12)
contentView.grid.axis.rows = 3
contentView.grid.spacing = -8
contentView.grid.contentInset.top = -8
} else {
v.grid.rows = 1
v.font = v.font?.fontWithSize(20)
contentView.grid.axis.rows = 1
contentView.grid.spacing = 0
contentView.grid.contentInset.top = 0
}
}
contentView.grid.views = []
if let v: UILabel = titleLabel {
contentView.grid.views?.append(v)
}
if let v: UILabel = detailLabel {
contentView.grid.views?.append(v)
}
grid.reloadLayout()
contentView.grid.reloadLayout()
}
}
/// Prepares the contentView.
public override func prepareContentView() {
super.prepareContentView()
contentView.grid.axis.direction = .Vertical
}
/**
Used to trigger property changes that initializers avoid.
- Parameter titleLabel: UILabel for the title.
- Parameter detailLabel: UILabel for the details.
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
internal func prepareProperties(titleLabel: UILabel?, detailLabel: UILabel?, leftControls: Array<UIControl>?, rightControls: Array<UIControl>?) {
prepareProperties(leftControls, rightControls: rightControls)
self.titleLabel = titleLabel
self.detailLabel = detailLabel
}
}
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public extension UIViewController {
/**
A convenience property that provides access to the NavigationBarViewController.
This is the recommended method of accessing the NavigationBarViewController
through child UIViewControllers.
*/
public var navigationBarViewController: NavigationBarViewController? {
var viewController: UIViewController? = self
while nil != viewController {
if viewController is NavigationBarViewController {
return viewController as? NavigationBarViewController
}
viewController = viewController?.parentViewController
}
return nil
}
}
@objc(NavigationBarViewControllerDelegate)
public protocol NavigationBarViewControllerDelegate : MaterialDelegate {
/// Delegation method that executes when the floatingViewController will open.
optional func navigationBarViewControllerWillOpenFloatingViewController(navigationBarViewController: NavigationBarViewController)
/// Delegation method that executes when the floatingViewController will close.
optional func navigationBarViewControllerWillCloseFloatingViewController(navigationBarViewController: NavigationBarViewController)
/// Delegation method that executes when the floatingViewController did open.
optional func navigationBarViewControllerDidOpenFloatingViewController(navigationBarViewController: NavigationBarViewController)
/// Delegation method that executes when the floatingViewController did close.
optional func navigationBarViewControllerDidCloseFloatingViewController(navigationBarViewController: NavigationBarViewController)
}
@objc(NavigationBarViewController)
public class NavigationBarViewController: StatusBarViewController {
/// The height of the StatusBar.
public override var heightForStatusBar: CGFloat {
get {
return navigationBarView.heightForStatusBar
}
set(value) {
navigationBarView.heightForStatusBar = value
}
}
/// The height when in Portrait orientation mode.
public override var heightForPortraitOrientation: CGFloat {
get {
return navigationBarView.heightForPortraitOrientation
}
set(value) {
navigationBarView.heightForPortraitOrientation = value
}
}
/// The height when in Landscape orientation mode.
public override var heightForLandscapeOrientation: CGFloat {
get {
return navigationBarView.heightForLandscapeOrientation
}
set(value) {
navigationBarView.heightForLandscapeOrientation = value
}
}
/// Internal reference to the floatingViewController.
private var internalFloatingViewController: UIViewController?
/// Reference to the NavigationBarView.
public private(set) lazy var navigationBarView: NavigationBarView = NavigationBarView()
/// Delegation handler.
public weak var delegate: NavigationBarViewControllerDelegate?
/// A floating UIViewController.
public var floatingViewController: UIViewController? {
get {
return internalFloatingViewController
}
set(value) {
if let v: UIViewController = internalFloatingViewController {
v.view.layer.rasterizationScale = MaterialDevice.scale
v.view.layer.shouldRasterize = true
delegate?.navigationBarViewControllerWillCloseFloatingViewController?(self)
internalFloatingViewController = nil
UIView.animateWithDuration(0.5,
animations: { [unowned self] in
v.view.center.y = 2 * self.view.bounds.height
self.navigationBarView.alpha = 1
self.mainViewController.view.alpha = 1
}) { [unowned self] _ in
v.willMoveToParentViewController(nil)
v.view.removeFromSuperview()
v.removeFromParentViewController()
v.view.layer.shouldRasterize = false
self.userInteractionEnabled = true
self.navigationBarView.userInteractionEnabled = true
dispatch_async(dispatch_get_main_queue()) { [unowned self] in
self.delegate?.navigationBarViewControllerDidCloseFloatingViewController?(self)
}
}
}
if let v: UIViewController = value {
// Add the noteViewController! to the view.
addChildViewController(v)
v.view.frame = view.bounds
v.view.center.y = 2 * view.bounds.height
v.view.hidden = true
view.insertSubview(v.view, aboveSubview: navigationBarView)
v.view.layer.zPosition = 1500
v.didMoveToParentViewController(self)
// Animate the noteButton out and the noteViewController! in.
v.view.hidden = false
v.view.layer.rasterizationScale = MaterialDevice.scale
v.view.layer.shouldRasterize = true
view.layer.rasterizationScale = MaterialDevice.scale
view.layer.shouldRasterize = true
internalFloatingViewController = v
userInteractionEnabled = false
navigationBarView.userInteractionEnabled = false
delegate?.navigationBarViewControllerWillOpenFloatingViewController?(self)
UIView.animateWithDuration(0.5,
animations: { [unowned self] in
v.view.center.y = self.view.bounds.height / 2
self.navigationBarView.alpha = 0.5
self.mainViewController.view.alpha = 0.5
}) { [unowned self] _ in
v.view.layer.shouldRasterize = false
self.view.layer.shouldRasterize = false
dispatch_async(dispatch_get_main_queue()) { [unowned self] in
self.delegate?.navigationBarViewControllerDidOpenFloatingViewController?(self)
}
}
}
}
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
public override func prepareView() {
super.prepareView()
prepareNavigationBarView()
}
/// Prepares the NavigationBarView.
private func prepareNavigationBarView() {
navigationBarView.zPosition = 1000
view.addSubview(navigationBarView)
}
}
......@@ -31,14 +31,27 @@
import UIKit
public class NavigationController : UINavigationController {
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
/**
An initializer that initializes the object with an Optional nib and bundle.
- Parameter nibNameOrNil: An Optional String for the nib.
- Parameter bundle: An Optional NSBundle where the nib is located.
*/
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
/**
An initializer that initializes the object with a rootViewController.
- Parameter rootViewController: A UIViewController for the rootViewController.
*/
public override init(rootViewController: UIViewController) {
super.init(navigationBarClass: NavigationBar.self, toolbarClass: nil)
setViewControllers([rootViewController], animated: false)
......@@ -46,26 +59,31 @@ public class NavigationController : UINavigationController {
public override func viewDidLoad() {
super.viewDidLoad()
// This ensures the panning gesture is available when going back between views.
interactivePopGestureRecognizer?.delegate = nil
}
public override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
navigationBar.layoutSubviews()
}
public override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
if let v: UINavigationItem = navigationBar.topItem {
v.title = ""
prepareTitle(v)
(navigationBar as? NavigationBar)?.layoutNavigationItem(v)
}
}
/**
Delegation method that is called when a new UINavigationItem is about to be pushed.
This is used to prepare the transitions between UIViewControllers on the stack.
- Parameter navigationBar: A UINavigationBar that is used in the NavigationController.
- Parameter item: The UINavigationItem that will be pushed on the stack.
- Returns: A Boolean value that indicates whether to push the item on to the stack or not.
True is yes, false is no.
*/
public func navigationBar(navigationBar: UINavigationBar, shouldPushItem item: UINavigationItem) -> Bool {
item.title = ""
item.setHidesBackButton(true, animated: false)
if let v: NavigationBar = navigationBar as? NavigationBar {
prepareTitle(item)
item.setHidesBackButton(true, animated: false)
if var c: Array<UIControl> = item.leftControls {
c.append(v.backButton)
item.leftControls = c
......@@ -79,7 +97,15 @@ public class NavigationController : UINavigationController {
return true
}
/// Handler for the back button.
internal func handleBackButton() {
popViewControllerAnimated(true)
}
/// Prepares the title if it's value is nil.
private func prepareTitle(item: UINavigationItem) {
if nil == item.title {
item.title = ""
}
}
}
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