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