Commit 84197934 by Daniel Dahan

updated NavigationBarView to Toolbar, SideNavigationView* to SideNavigation*,…

updated NavigationBarView to Toolbar, SideNavigationView* to SideNavigation*, SearchBarView to SearchBar
parent 165620da
......@@ -47,22 +47,22 @@
location = "group:Programmatic/MenuViewController/MenuViewController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/NavigationBar/NavigationBar.xcodeproj">
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/NavigationBar/NavigationBar.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/NavigationBarView/NavigationBarView.xcodeproj">
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/NavigationBarView/Toolbar.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/NavigationBarViewController/NavigationBarViewController.xcodeproj">
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/NavigationBarViewController/ToolbarController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/SearchBarView/SearchBarView.xcodeproj">
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/SearchBarView/SearchBar.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/SearchBarViewController/SearchBarViewController.xcodeproj">
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/SearchBarViewController/SearchBarController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/SideNavigationViewController/SideNavigationViewController.xcodeproj">
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/SideNavigationViewController/SideNavigationController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/CardView/CardView.xcodeproj">
......
......@@ -7,8 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
963236121C96512C00282A94 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963236111C96512C00282A94 /* Material.framework */; };
963236131C96512C00282A94 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 963236111C96512C00282A94 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9663F9321C7A744600AF0965 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9311C7A744600AF0965 /* AppDelegate.swift */; };
9663F9341C7A744600AF0965 /* RecommendationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9331C7A744600AF0965 /* RecommendationViewController.swift */; };
9663F9391C7A744600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9381C7A744600AF0965 /* Assets.xcassets */; };
......@@ -20,6 +18,8 @@
9663F9501C7A74FC00AF0965 /* AppRightViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94F1C7A74FC00AF0965 /* AppRightViewController.swift */; };
9663F9521C7A751D00AF0965 /* ItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9511C7A751D00AF0965 /* ItemViewController.swift */; };
96CC08881C7FEBD60034FF84 /* RecipesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */; };
96F2F1B11C979D3B00A5FE27 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96F2F1B01C979D3B00A5FE27 /* Material.framework */; };
96F2F1B21C979D3B00A5FE27 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96F2F1B01C979D3B00A5FE27 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -29,7 +29,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
963236131C96512C00282A94 /* Material.framework in Embed Frameworks */,
96F2F1B21C979D3B00A5FE27 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -37,7 +37,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
963236111C96512C00282A94 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
9663F92E1C7A744600AF0965 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
9663F9311C7A744600AF0965 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9663F9331C7A744600AF0965 /* RecommendationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendationViewController.swift; sourceTree = "<group>"; };
......@@ -51,6 +50,7 @@
9663F94F1C7A74FC00AF0965 /* AppRightViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppRightViewController.swift; sourceTree = "<group>"; };
9663F9511C7A751D00AF0965 /* ItemViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemViewController.swift; sourceTree = "<group>"; };
96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecipesViewController.swift; sourceTree = "<group>"; };
96F2F1B01C979D3B00A5FE27 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -58,7 +58,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
963236121C96512C00282A94 /* Material.framework in Frameworks */,
96F2F1B11C979D3B00A5FE27 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -68,7 +68,7 @@
9663F9251C7A744500AF0965 = {
isa = PBXGroup;
children = (
963236111C96512C00282A94 /* Material.framework */,
96F2F1B01C979D3B00A5FE27 /* Material.framework */,
9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */,
);
......
......@@ -39,7 +39,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationController(rootViewController: RecipesViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
window!.rootViewController = SideNavigationController(mainViewController: AppMenuViewController(mainViewController: AppNavigationController(rootViewController: RecipesViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
window!.makeKeyAndVisible()
return true
}
......
......@@ -30,7 +30,7 @@
/*
The following is an example of setting a UITableView as the LeftViewController
within a SideNavigationViewController.
within a SideNavigationController.
*/
import UIKit
......
......@@ -51,13 +51,13 @@ class AppMenuViewController: MenuViewController {
override func openMenu(completion: (() -> Void)? = nil) {
super.openMenu(completion)
sideNavigationViewController?.enabled = false
sideNavigationController?.enabled = false
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 45))
}
override func closeMenu(completion: (() -> Void)? = nil) {
super.closeMenu(completion)
sideNavigationViewController?.enabled = true
sideNavigationController?.enabled = true
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 0))
}
......
......@@ -30,7 +30,7 @@
/*
The following is an example of setting a UITableView as the RightViewController
within a SideNavigationViewController.
within a SideNavigationController.
*/
import UIKit
......
......@@ -29,44 +29,44 @@
*/
/*
The following is an example of using a SearchBarViewController to control the
The following is an example of using a SearchBarController to control the
flow of your application.
*/
import UIKit
import Material
class AppSearchBarViewController: SearchBarViewController {
class AppSearchBarController: SearchBarController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareSearchBarView()
prepareSearchBar()
}
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
sideNavigationViewController?.enabled = true
sideNavigationController?.enabled = true
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
searchBarView.statusBarStyle = .Default
sideNavigationViewController?.delegate = self
sideNavigationViewController?.enabled = false
searchBar.statusBarStyle = .Default
sideNavigationController?.delegate = self
sideNavigationController?.enabled = false
}
/// Toggle SideSearchViewController left UIViewController.
internal func handleBackButton() {
searchBarView.textField.resignFirstResponder()
searchBar.textField.resignFirstResponder()
dismissViewControllerAnimated(true, completion: nil)
}
/// Toggle SideSearchViewController right UIViewController.
internal func handleMoreButton() {
searchBarView.textField.resignFirstResponder()
searchBar.textField.resignFirstResponder()
print(presentingViewController?.view.layer.zPosition)
sideNavigationViewController?.enabledRightView = true
sideNavigationViewController?.toggleRightView()
sideNavigationController?.enabledRightView = true
sideNavigationController?.toggleRightView()
}
/// Prepares view.
......@@ -75,8 +75,8 @@ class AppSearchBarViewController: SearchBarViewController {
view.backgroundColor = MaterialColor.black
}
/// Prepares the searchBarView.
private func prepareSearchBarView() {
/// Prepares the searchBar.
private func prepareSearchBar() {
var image = UIImage(named: "ic_close_white")?.imageWithRenderingMode(.AlwaysTemplate)
let clearButton: FlatButton = FlatButton()
......@@ -105,22 +105,22 @@ class AppSearchBarViewController: SearchBarViewController {
moreButton.setImage(image, forState: .Normal)
moreButton.setImage(image, forState: .Highlighted)
searchBarView.placeholder = "Search"
searchBarView.tintColor = MaterialColor.grey.darken4
searchBarView.textColor = MaterialColor.grey.darken4
searchBarView.placeholderTextColor = MaterialColor.grey.darken4
searchBarView.textField.font = RobotoFont.regular
searchBarView.textField.delegate = self
searchBarView.contentInset.left = 8
searchBarView.contentInset.right = 8
searchBar.placeholder = "Search"
searchBar.tintColor = MaterialColor.grey.darken4
searchBar.textColor = MaterialColor.grey.darken4
searchBar.placeholderTextColor = MaterialColor.grey.darken4
searchBar.textField.font = RobotoFont.regular
searchBar.textField.delegate = self
searchBar.contentInset.left = 8
searchBar.contentInset.right = 8
searchBarView.clearButton = clearButton
searchBarView.leftControls = [backButton]
searchBarView.rightControls = [moreButton]
searchBar.clearButton = clearButton
searchBar.leftControls = [backButton]
searchBar.rightControls = [moreButton]
}
}
extension AppSearchBarViewController: TextFieldDelegate {
extension AppSearchBarController: TextFieldDelegate {
func textFieldDidBeginEditing(textField: UITextField) {
print("Begin searching....")
}
......@@ -130,8 +130,8 @@ extension AppSearchBarViewController: TextFieldDelegate {
}
}
extension AppSearchBarViewController: SideNavigationViewControllerDelegate {
func sideNavigationViewDidClose(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) {
sideNavigationViewController.enabled = false
extension AppSearchBarController: SideNavigationControllerDelegate {
func sideNavigationDidClose(sideNavigationController: SideNavigationController, position: SideNavigationPosition) {
sideNavigationController.enabled = false
}
}
......@@ -34,6 +34,8 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
......
......@@ -67,7 +67,7 @@ class RecipesViewController: UIViewController {
navigationController?.navigationBar.statusBarStyle = .LightContent
// Enable the SideNavigation.
sideNavigationViewController?.enabled = true
sideNavigationController?.enabled = true
// Show the menuView.
menuViewController?.menuView.animate(MaterialAnimation.animationGroup([
......@@ -79,7 +79,7 @@ class RecipesViewController: UIViewController {
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
// Disable the SideNavigation.
sideNavigationViewController?.enabled = false
sideNavigationController?.enabled = false
// Hide the menuView.
menuViewController?.menuView.animate(MaterialAnimation.animationGroup([
......@@ -90,7 +90,7 @@ class RecipesViewController: UIViewController {
/// Handles the menuButton.
internal func handleMenuButton() {
sideNavigationViewController?.openLeftView()
sideNavigationController?.openLeftView()
}
/// Handles the searchButton.
......@@ -99,7 +99,7 @@ class RecipesViewController: UIViewController {
recommended.append(dataSourceItems[0])
recommended.append(dataSourceItems[1])
recommended.append(dataSourceItems[2])
navigationController?.presentViewController(AppSearchBarViewController(mainViewController: RecommendationViewController(dataSourceItems: recommended)), animated: true, completion: nil)
navigationController?.presentViewController(AppSearchBarController(mainViewController: RecommendationViewController(dataSourceItems: recommended)), animated: true, completion: nil)
}
/// Prepares the items Array.
......
......@@ -34,7 +34,7 @@ import AVFoundation
class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDelegate {
lazy var captureView: CaptureView = CaptureView()
lazy var navigationBarView: NavigationBarView = NavigationBarView()
lazy var toolbar: Toolbar = Toolbar()
lazy var cameraButton: FlatButton = FlatButton()
lazy var videoButton: FlatButton = FlatButton()
lazy var switchCamerasButton: FlatButton = FlatButton()
......@@ -50,7 +50,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
prepareSwitchCamerasButton()
prepareFlashButton()
prepareCaptureView()
prepareNavigationBarView()
prepareToolbar()
}
/**
......@@ -99,24 +99,24 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
}
func captureViewDidStartRecordTimer(captureView: CaptureView) {
navigationBarView.titleLabel!.text = "00:00:00"
navigationBarView.titleLabel!.hidden = false
navigationBarView.detailLabel!.hidden = false
toolbar.titleLabel!.text = "00:00:00"
toolbar.titleLabel!.hidden = false
toolbar.detailLabel!.hidden = false
}
/**
:name: captureViewDidUpdateRecordTimer
*/
func captureViewDidUpdateRecordTimer(captureView: CaptureView, hours: Int, minutes: Int, seconds: Int) {
navigationBarView.titleLabel!.text = String(format: "%02i:%02i:%02i", arguments: [hours, minutes, seconds])
toolbar.titleLabel!.text = String(format: "%02i:%02i:%02i", arguments: [hours, minutes, seconds])
}
/**
:name: captureViewDidStopRecordTimer
*/
func captureViewDidStopRecordTimer(captureView: CaptureView, hours: Int, minutes: Int, seconds: Int) {
navigationBarView.titleLabel!.hidden = true
navigationBarView.detailLabel!.hidden = true
toolbar.titleLabel!.hidden = true
toolbar.detailLabel!.hidden = true
}
/**
......@@ -231,12 +231,12 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
}
/**
:name: prepareNavigationBarView
:name: prepareToolbar
*/
private func prepareNavigationBarView() {
navigationBarView.backgroundColor = nil
navigationBarView.depth = .None
navigationBarView.statusBarStyle = .LightContent
private func prepareToolbar() {
toolbar.backgroundColor = nil
toolbar.depth = .None
toolbar.statusBarStyle = .LightContent
// Title label.
let titleLabel: UILabel = UILabel()
......@@ -244,7 +244,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
titleLabel.textAlignment = .Center
titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regular
navigationBarView.titleLabel = titleLabel
toolbar.titleLabel = titleLabel
// Detail label.
let detailLabel: UILabel = UILabel()
......@@ -253,12 +253,12 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
detailLabel.textAlignment = .Center
detailLabel.textColor = MaterialColor.red.accent1
detailLabel.font = RobotoFont.regular
navigationBarView.detailLabel = detailLabel
toolbar.detailLabel = detailLabel
navigationBarView.leftControls = [switchCamerasButton]
navigationBarView.rightControls = [flashButton]
toolbar.leftControls = [switchCamerasButton]
toolbar.rightControls = [flashButton]
view.addSubview(navigationBarView)
view.addSubview(toolbar)
}
/**
......
......@@ -73,7 +73,7 @@ class AppMenuViewController: MenuViewController {
/// Loads the YellowViewController into the menuViewControllers mainViewController.
func handleYellowButton() {
// if (mainViewController as? NavigationBarViewController)?.mainViewController is YellowViewController {
// if (mainViewController as? ToolbarController)?.mainViewController is YellowViewController {
// return
// }
......
......@@ -7,10 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
96EFD71A1C8F73C70063F49E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EFD7191C8F73C70063F49E /* AppDelegate.swift */; };
96EFD71C1C8F73C70063F49E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EFD71B1C8F73C70063F49E /* ViewController.swift */; };
96EFD7211C8F73C70063F49E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96EFD7201C8F73C70063F49E /* Assets.xcassets */; };
96EFD7241C8F73C70063F49E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96EFD7221C8F73C70063F49E /* LaunchScreen.storyboard */; };
96F2F1BB1C97A4F800A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1B51C97A4F800A5FE27 /* AppDelegate.swift */; };
96F2F1BC1C97A4F800A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1B61C97A4F800A5FE27 /* Assets.xcassets */; };
96F2F1BD1C97A4F800A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1B71C97A4F800A5FE27 /* LaunchScreen.storyboard */; };
96F2F1BF1C97A4F800A5FE27 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1BA1C97A4F800A5FE27 /* ViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -28,11 +28,11 @@
/* Begin PBXFileReference section */
96EFD7161C8F73C60063F49E /* NavigationBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96EFD7191C8F73C70063F49E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96EFD71B1C8F73C70063F49E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
96EFD7201C8F73C70063F49E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96EFD7231C8F73C70063F49E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96EFD7251C8F73C70063F49E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96F2F1B51C97A4F800A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96F2F1B61C97A4F800A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96F2F1B81C97A4F800A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96F2F1B91C97A4F800A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96F2F1BA1C97A4F800A5FE27 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -49,7 +49,7 @@
96EFD70D1C8F73C60063F49E = {
isa = PBXGroup;
children = (
96EFD7181C8F73C60063F49E /* NavigationBar */,
96F2F1B41C97A4F800A5FE27 /* NavigationBar */,
96EFD7171C8F73C60063F49E /* Products */,
);
sourceTree = "<group>";
......@@ -62,14 +62,14 @@
name = Products;
sourceTree = "<group>";
};
96EFD7181C8F73C60063F49E /* NavigationBar */ = {
96F2F1B41C97A4F800A5FE27 /* NavigationBar */ = {
isa = PBXGroup;
children = (
96EFD7191C8F73C70063F49E /* AppDelegate.swift */,
96EFD71B1C8F73C70063F49E /* ViewController.swift */,
96EFD7201C8F73C70063F49E /* Assets.xcassets */,
96EFD7221C8F73C70063F49E /* LaunchScreen.storyboard */,
96EFD7251C8F73C70063F49E /* Info.plist */,
96F2F1B51C97A4F800A5FE27 /* AppDelegate.swift */,
96F2F1BA1C97A4F800A5FE27 /* ViewController.swift */,
96F2F1B61C97A4F800A5FE27 /* Assets.xcassets */,
96F2F1B71C97A4F800A5FE27 /* LaunchScreen.storyboard */,
96F2F1B91C97A4F800A5FE27 /* Info.plist */,
);
path = NavigationBar;
sourceTree = "<group>";
......@@ -133,8 +133,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96EFD7241C8F73C70063F49E /* LaunchScreen.storyboard in Resources */,
96EFD7211C8F73C70063F49E /* Assets.xcassets in Resources */,
96F2F1BC1C97A4F800A5FE27 /* Assets.xcassets in Resources */,
96F2F1BD1C97A4F800A5FE27 /* LaunchScreen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -145,18 +145,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96EFD71C1C8F73C70063F49E /* ViewController.swift in Sources */,
96EFD71A1C8F73C70063F49E /* AppDelegate.swift in Sources */,
96F2F1BF1C97A4F800A5FE27 /* ViewController.swift in Sources */,
96F2F1BB1C97A4F800A5FE27 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96EFD7221C8F73C70063F49E /* LaunchScreen.storyboard */ = {
96F2F1B71C97A4F800A5FE27 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96EFD7231C8F73C70063F49E /* Base */,
96F2F1B81C97A4F800A5FE27 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
......@@ -254,7 +254,7 @@
INFOPLIST_FILE = NavigationBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBar;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = NavigationBar;
};
name = Debug;
};
......@@ -265,7 +265,7 @@
INFOPLIST_FILE = NavigationBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBar;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = NavigationBar;
};
name = Release;
};
......
......@@ -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>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
......@@ -44,5 +42,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
......@@ -7,10 +7,10 @@
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 */; };
96F2F1C71C97A52F00A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1C11C97A52F00A5FE27 /* AppDelegate.swift */; };
96F2F1C81C97A52F00A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1C21C97A52F00A5FE27 /* Assets.xcassets */; };
96F2F1C91C97A52F00A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1C31C97A52F00A5FE27 /* LaunchScreen.storyboard */; };
96F2F1CB1C97A52F00A5FE27 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1C61C97A52F00A5FE27 /* ViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -27,12 +27,12 @@
/* 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>"; };
96D88C7F1C132C1800B91418 /* Toolbar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Toolbar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96F2F1C11C97A52F00A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96F2F1C21C97A52F00A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96F2F1C41C97A52F00A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96F2F1C51C97A52F00A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96F2F1C61C97A52F00A5FE27 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -49,7 +49,7 @@
96D88C761C132C1800B91418 = {
isa = PBXGroup;
children = (
96D88C811C132C1800B91418 /* NavigationBarView */,
96F2F1C01C97A52F00A5FE27 /* Toolbar */,
96D88C801C132C1800B91418 /* Products */,
);
sourceTree = "<group>";
......@@ -57,29 +57,29 @@
96D88C801C132C1800B91418 /* Products */ = {
isa = PBXGroup;
children = (
96D88C7F1C132C1800B91418 /* NavigationBarView.app */,
96D88C7F1C132C1800B91418 /* Toolbar.app */,
);
name = Products;
sourceTree = "<group>";
};
96D88C811C132C1800B91418 /* NavigationBarView */ = {
96F2F1C01C97A52F00A5FE27 /* Toolbar */ = {
isa = PBXGroup;
children = (
96D88C821C132C1800B91418 /* AppDelegate.swift */,
96D88C841C132C1800B91418 /* ViewController.swift */,
96D88C891C132C1800B91418 /* Assets.xcassets */,
96D88C8B1C132C1800B91418 /* LaunchScreen.storyboard */,
96D88C8E1C132C1900B91418 /* Info.plist */,
96F2F1C11C97A52F00A5FE27 /* AppDelegate.swift */,
96F2F1C61C97A52F00A5FE27 /* ViewController.swift */,
96F2F1C21C97A52F00A5FE27 /* Assets.xcassets */,
96F2F1C31C97A52F00A5FE27 /* LaunchScreen.storyboard */,
96F2F1C51C97A52F00A5FE27 /* Info.plist */,
);
path = NavigationBarView;
path = Toolbar;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96D88C7E1C132C1800B91418 /* NavigationBarView */ = {
96D88C7E1C132C1800B91418 /* Toolbar */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96D88C911C132C1900B91418 /* Build configuration list for PBXNativeTarget "NavigationBarView" */;
buildConfigurationList = 96D88C911C132C1900B91418 /* Build configuration list for PBXNativeTarget "Toolbar" */;
buildPhases = (
96D88C7B1C132C1800B91418 /* Sources */,
96D88C7C1C132C1800B91418 /* Frameworks */,
......@@ -90,9 +90,9 @@
);
dependencies = (
);
name = NavigationBarView;
name = Toolbar;
productName = NavigationBarView;
productReference = 96D88C7F1C132C1800B91418 /* NavigationBarView.app */;
productReference = 96D88C7F1C132C1800B91418 /* Toolbar.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
......@@ -110,7 +110,7 @@
};
};
};
buildConfigurationList = 96D88C7A1C132C1800B91418 /* Build configuration list for PBXProject "NavigationBarView" */;
buildConfigurationList = 96D88C7A1C132C1800B91418 /* Build configuration list for PBXProject "Toolbar" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
......@@ -123,7 +123,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
96D88C7E1C132C1800B91418 /* NavigationBarView */,
96D88C7E1C132C1800B91418 /* Toolbar */,
);
};
/* End PBXProject section */
......@@ -133,8 +133,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96D88C8D1C132C1800B91418 /* LaunchScreen.storyboard in Resources */,
96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */,
96F2F1C81C97A52F00A5FE27 /* Assets.xcassets in Resources */,
96F2F1C91C97A52F00A5FE27 /* LaunchScreen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -145,18 +145,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96D88C851C132C1800B91418 /* ViewController.swift in Sources */,
96D88C831C132C1800B91418 /* AppDelegate.swift in Sources */,
96F2F1CB1C97A52F00A5FE27 /* ViewController.swift in Sources */,
96F2F1C71C97A52F00A5FE27 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96D88C8B1C132C1800B91418 /* LaunchScreen.storyboard */ = {
96F2F1C31C97A52F00A5FE27 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96D88C8C1C132C1800B91418 /* Base */,
96F2F1C41C97A52F00A5FE27 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
......@@ -251,10 +251,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarView/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Toolbar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarView;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Toolbar;
PRODUCT_NAME = Toolbar;
};
name = Debug;
};
......@@ -262,17 +262,17 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarView/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Toolbar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarView;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Toolbar;
PRODUCT_NAME = Toolbar;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96D88C7A1C132C1800B91418 /* Build configuration list for PBXProject "NavigationBarView" */ = {
96D88C7A1C132C1800B91418 /* Build configuration list for PBXProject "Toolbar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96D88C8F1C132C1900B91418 /* Debug */,
......@@ -281,7 +281,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96D88C911C132C1900B91418 /* Build configuration list for PBXNativeTarget "NavigationBarView" */ = {
96D88C911C132C1900B91418 /* Build configuration list for PBXNativeTarget "Toolbar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96D88C921C132C1900B91418 /* Debug */,
......
......@@ -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>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
......@@ -44,5 +42,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
......@@ -29,7 +29,7 @@
*/
/*
A NavigationBarView is a fully featured NavigationBar that supports orientation
A Toolbar is a fully featured NavigationBar that supports orientation
changes, background images, title and detail labels, both left and right UIControl
sets, and status bar settings. Below is an example of its usage.
*/
......@@ -38,13 +38,13 @@ import UIKit
import Material
class ViewController: UIViewController {
/// Reference for NavigationBarView.
private var navigationBarView: NavigationBarView = NavigationBarView()
/// Reference for Toolbar.
private var toolbar: Toolbar = Toolbar()
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareNavigationBarView()
prepareToolbar()
}
/// General preparation statements.
......@@ -52,8 +52,8 @@ class ViewController: UIViewController {
view.backgroundColor = MaterialColor.white
}
/// Prepares the navigationBarView
private func prepareNavigationBarView() {
/// Prepares the toolbar
private func prepareToolbar() {
// Title label.
let titleLabel: UILabel = UILabel()
titleLabel.text = "Material"
......@@ -93,14 +93,14 @@ class ViewController: UIViewController {
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
toolbar.statusBarStyle = .LightContent
navigationBarView.backgroundColor = MaterialColor.blue.base
navigationBarView.titleLabel = titleLabel
navigationBarView.detailLabel = detailLabel
navigationBarView.leftControls = [menuButton]
navigationBarView.rightControls = [switchControl, searchButton]
toolbar.backgroundColor = MaterialColor.blue.base
toolbar.titleLabel = titleLabel
toolbar.detailLabel = detailLabel
toolbar.leftControls = [menuButton]
toolbar.rightControls = [switchControl, searchButton]
view.addSubview(navigationBarView)
view.addSubview(toolbar)
}
}
......@@ -39,7 +39,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = AppNavigationBarViewController(mainViewController: YellowViewController())
window!.rootViewController = AppToolbarController(mainViewController: YellowViewController())
window!.makeKeyAndVisible()
return true
}
......
......@@ -29,18 +29,18 @@
*/
/*
The following is an example of using a NavigationBarViewController to control the
The following is an example of using a ToolbarController to control the
flow of your application.
*/
import UIKit
import Material
class AppNavigationBarViewController: NavigationBarViewController {
class AppToolbarController: ToolbarController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareNavigationBarView()
prepareToolbar()
}
override func viewWillAppear(animated: Bool) {
......@@ -50,7 +50,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
toolbar.statusBarStyle = .LightContent
}
/// Prepares view.
......@@ -59,12 +59,12 @@ class AppNavigationBarViewController: NavigationBarViewController {
view.backgroundColor = MaterialColor.black
}
/// Toggle SideNavigationViewController left UIViewController.
/// Toggle SideNavigationController left UIViewController.
internal func handleMenuButton() {
transitionFromMainViewController(GreenViewController(), options: [.TransitionCrossDissolve])
}
/// Toggle SideNavigationViewController right UIViewController.
/// Toggle SideNavigationController right UIViewController.
internal func handleSearchButton() {
floatingViewController = BlueViewController()
......@@ -74,8 +74,8 @@ class AppNavigationBarViewController: NavigationBarViewController {
}
}
/// Prepares the navigationBarView.
private func prepareNavigationBarView() {
/// Prepares the toolbar.
private func prepareToolbar() {
// Title label.
let titleLabel: UILabel = UILabel()
titleLabel.text = "Material"
......@@ -89,7 +89,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
// detailLabel.textAlignment = .Left
// detailLabel.textColor = MaterialColor.white
// detailLabel.font = RobotoFont.regular
// navigationBarView.detailLabel = detailLabel
// toolbar.detailLabel = detailLabel
var image = UIImage(named: "ic_menu_white")
......@@ -114,14 +114,14 @@ class AppNavigationBarViewController: NavigationBarViewController {
searchButton.setImage(image, forState: .Highlighted)
searchButton.addTarget(self, action: "handleSearchButton", forControlEvents: .TouchUpInside)
navigationBarView.backgroundColor = MaterialColor.blue.base
navigationBarView.titleLabel = titleLabel
navigationBarView.leftControls = [menuButton]
navigationBarView.rightControls = [switchControl, searchButton]
toolbar.backgroundColor = MaterialColor.blue.base
toolbar.titleLabel = titleLabel
toolbar.leftControls = [menuButton]
toolbar.rightControls = [switchControl, searchButton]
}
}
extension AppNavigationBarViewController: MaterialSwitchDelegate {
extension AppToolbarController: MaterialSwitchDelegate {
func materialSwitchStateChanged(control: MaterialSwitch) {
transitionFromMainViewController(YellowViewController(), options: [.TransitionCrossDissolve])
}
......
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