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)
} }
} }
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
9600361B1C7828BB00EBA579 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9600361A1C7828BB00EBA579 /* BlueViewController.swift */; }; 96F2F1D61C97A55B00A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1CD1C97A55B00A5FE27 /* AppDelegate.swift */; };
9600361D1C7829EF00EBA579 /* GreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9600361C1C7829EF00EBA579 /* GreenViewController.swift */; }; 96F2F1D71C97A55B00A5FE27 /* AppToolbarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1CE1C97A55B00A5FE27 /* AppToolbarController.swift */; };
96A71FC41C765FDF00C0C4AE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FC31C765FDF00C0C4AE /* AppDelegate.swift */; }; 96F2F1D81C97A55B00A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1CF1C97A55B00A5FE27 /* Assets.xcassets */; };
96A71FC61C765FDF00C0C4AE /* AppNavigationBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FC51C765FDF00C0C4AE /* AppNavigationBarViewController.swift */; }; 96F2F1D91C97A55B00A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1D01C97A55B00A5FE27 /* LaunchScreen.storyboard */; };
96A71FCB1C765FDF00C0C4AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96A71FCA1C765FDF00C0C4AE /* Assets.xcassets */; }; 96F2F1DA1C97A55B00A5FE27 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1D21C97A55B00A5FE27 /* BlueViewController.swift */; };
96A71FCE1C765FDF00C0C4AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96A71FCC1C765FDF00C0C4AE /* LaunchScreen.storyboard */; }; 96F2F1DB1C97A55B00A5FE27 /* GreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1D31C97A55B00A5FE27 /* GreenViewController.swift */; };
96A71FD61C76618D00C0C4AE /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FD51C76618D00C0C4AE /* YellowViewController.swift */; }; 96F2F1DD1C97A55B00A5FE27 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1D51C97A55B00A5FE27 /* YellowViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9600361A1C7828BB00EBA579 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; }; 96A71FC01C765FDF00C0C4AE /* ToolbarController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ToolbarController.app; sourceTree = BUILT_PRODUCTS_DIR; };
9600361C1C7829EF00EBA579 /* GreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewController.swift; sourceTree = "<group>"; }; 96F2F1CD1C97A55B00A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96A71FC01C765FDF00C0C4AE /* NavigationBarViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 96F2F1CE1C97A55B00A5FE27 /* AppToolbarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppToolbarController.swift; sourceTree = "<group>"; };
96A71FC31C765FDF00C0C4AE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96F2F1CF1C97A55B00A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96A71FC51C765FDF00C0C4AE /* AppNavigationBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppNavigationBarViewController.swift; sourceTree = "<group>"; }; 96F2F1D11C97A55B00A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96A71FCA1C765FDF00C0C4AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96F2F1D21C97A55B00A5FE27 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; };
96A71FCD1C765FDF00C0C4AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96F2F1D31C97A55B00A5FE27 /* GreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewController.swift; sourceTree = "<group>"; };
96A71FCF1C765FDF00C0C4AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96F2F1D41C97A55B00A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96A71FD51C76618D00C0C4AE /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; }; 96F2F1D51C97A55B00A5FE27 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
96A71FB71C765FDF00C0C4AE = { 96A71FB71C765FDF00C0C4AE = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71FC21C765FDF00C0C4AE /* NavigationBarViewController */, 96F2F1CC1C97A55B00A5FE27 /* ToolbarController */,
96A71FC11C765FDF00C0C4AE /* Products */, 96A71FC11C765FDF00C0C4AE /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -63,32 +63,32 @@ ...@@ -63,32 +63,32 @@
96A71FC11C765FDF00C0C4AE /* Products */ = { 96A71FC11C765FDF00C0C4AE /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71FC01C765FDF00C0C4AE /* NavigationBarViewController.app */, 96A71FC01C765FDF00C0C4AE /* ToolbarController.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96A71FC21C765FDF00C0C4AE /* NavigationBarViewController */ = { 96F2F1CC1C97A55B00A5FE27 /* ToolbarController */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71FC31C765FDF00C0C4AE /* AppDelegate.swift */, 96F2F1CD1C97A55B00A5FE27 /* AppDelegate.swift */,
96A71FC51C765FDF00C0C4AE /* AppNavigationBarViewController.swift */, 96F2F1CE1C97A55B00A5FE27 /* AppToolbarController.swift */,
96A71FD51C76618D00C0C4AE /* YellowViewController.swift */, 96F2F1D21C97A55B00A5FE27 /* BlueViewController.swift */,
9600361A1C7828BB00EBA579 /* BlueViewController.swift */, 96F2F1D31C97A55B00A5FE27 /* GreenViewController.swift */,
9600361C1C7829EF00EBA579 /* GreenViewController.swift */, 96F2F1D51C97A55B00A5FE27 /* YellowViewController.swift */,
96A71FCA1C765FDF00C0C4AE /* Assets.xcassets */, 96F2F1CF1C97A55B00A5FE27 /* Assets.xcassets */,
96A71FCC1C765FDF00C0C4AE /* LaunchScreen.storyboard */, 96F2F1D01C97A55B00A5FE27 /* LaunchScreen.storyboard */,
96A71FCF1C765FDF00C0C4AE /* Info.plist */, 96F2F1D41C97A55B00A5FE27 /* Info.plist */,
); );
path = NavigationBarViewController; path = ToolbarController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
96A71FBF1C765FDF00C0C4AE /* NavigationBarViewController */ = { 96A71FBF1C765FDF00C0C4AE /* ToolbarController */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 96A71FD21C765FDF00C0C4AE /* Build configuration list for PBXNativeTarget "NavigationBarViewController" */; buildConfigurationList = 96A71FD21C765FDF00C0C4AE /* Build configuration list for PBXNativeTarget "ToolbarController" */;
buildPhases = ( buildPhases = (
96A71FBC1C765FDF00C0C4AE /* Sources */, 96A71FBC1C765FDF00C0C4AE /* Sources */,
96A71FBD1C765FDF00C0C4AE /* Frameworks */, 96A71FBD1C765FDF00C0C4AE /* Frameworks */,
...@@ -99,9 +99,9 @@ ...@@ -99,9 +99,9 @@
); );
dependencies = ( dependencies = (
); );
name = NavigationBarViewController; name = ToolbarController;
productName = NavigationBarViewController; productName = NavigationBarViewController;
productReference = 96A71FC01C765FDF00C0C4AE /* NavigationBarViewController.app */; productReference = 96A71FC01C765FDF00C0C4AE /* ToolbarController.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
}; };
}; };
}; };
buildConfigurationList = 96A71FBB1C765FDF00C0C4AE /* Build configuration list for PBXProject "NavigationBarViewController" */; buildConfigurationList = 96A71FBB1C765FDF00C0C4AE /* Build configuration list for PBXProject "ToolbarController" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
96A71FBF1C765FDF00C0C4AE /* NavigationBarViewController */, 96A71FBF1C765FDF00C0C4AE /* ToolbarController */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96A71FCE1C765FDF00C0C4AE /* LaunchScreen.storyboard in Resources */, 96F2F1D81C97A55B00A5FE27 /* Assets.xcassets in Resources */,
96A71FCB1C765FDF00C0C4AE /* Assets.xcassets in Resources */, 96F2F1D91C97A55B00A5FE27 /* LaunchScreen.storyboard in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -154,21 +154,21 @@ ...@@ -154,21 +154,21 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9600361B1C7828BB00EBA579 /* BlueViewController.swift in Sources */, 96F2F1DB1C97A55B00A5FE27 /* GreenViewController.swift in Sources */,
96A71FD61C76618D00C0C4AE /* YellowViewController.swift in Sources */, 96F2F1D71C97A55B00A5FE27 /* AppToolbarController.swift in Sources */,
9600361D1C7829EF00EBA579 /* GreenViewController.swift in Sources */, 96F2F1DA1C97A55B00A5FE27 /* BlueViewController.swift in Sources */,
96A71FC61C765FDF00C0C4AE /* AppNavigationBarViewController.swift in Sources */, 96F2F1D61C97A55B00A5FE27 /* AppDelegate.swift in Sources */,
96A71FC41C765FDF00C0C4AE /* AppDelegate.swift in Sources */, 96F2F1DD1C97A55B00A5FE27 /* YellowViewController.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
96A71FCC1C765FDF00C0C4AE /* LaunchScreen.storyboard */ = { 96F2F1D01C97A55B00A5FE27 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
96A71FCD1C765FDF00C0C4AE /* Base */, 96F2F1D11C97A55B00A5FE27 /* Base */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -263,10 +263,10 @@ ...@@ -263,10 +263,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarViewController/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/ToolbarController/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarViewController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.ToolbarController;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = ToolbarController;
}; };
name = Debug; name = Debug;
}; };
...@@ -274,17 +274,17 @@ ...@@ -274,17 +274,17 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = NavigationBarViewController/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/ToolbarController/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.NavigationBarViewController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.ToolbarController;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = ToolbarController;
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
96A71FBB1C765FDF00C0C4AE /* Build configuration list for PBXProject "NavigationBarViewController" */ = { 96A71FBB1C765FDF00C0C4AE /* Build configuration list for PBXProject "ToolbarController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
96A71FD01C765FDF00C0C4AE /* Debug */, 96A71FD01C765FDF00C0C4AE /* Debug */,
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
96A71FD21C765FDF00C0C4AE /* Build configuration list for PBXNativeTarget "NavigationBarViewController" */ = { 96A71FD21C765FDF00C0C4AE /* Build configuration list for PBXNativeTarget "ToolbarController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
96A71FD31C765FDF00C0C4AE /* Debug */, 96A71FD31C765FDF00C0C4AE /* Debug */,
......
...@@ -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])
} }
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
96A71F081C718F8800C0C4AE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F071C718F8800C0C4AE /* AppDelegate.swift */; }; 96F2F1E51C97A5C800A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1DF1C97A5C800A5FE27 /* AppDelegate.swift */; };
96A71F0A1C718F8800C0C4AE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F091C718F8800C0C4AE /* ViewController.swift */; }; 96F2F1E61C97A5C800A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1E01C97A5C800A5FE27 /* Assets.xcassets */; };
96A71F0F1C718F8800C0C4AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96A71F0E1C718F8800C0C4AE /* Assets.xcassets */; }; 96F2F1E71C97A5C800A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1E11C97A5C800A5FE27 /* LaunchScreen.storyboard */; };
96A71F121C718F8800C0C4AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96A71F101C718F8800C0C4AE /* LaunchScreen.storyboard */; }; 96F2F1E91C97A5C800A5FE27 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1E41C97A5C800A5FE27 /* 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 */
96A71F041C718F8800C0C4AE /* SearchBarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchBarView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 96A71F041C718F8800C0C4AE /* SearchBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96A71F071C718F8800C0C4AE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96F2F1DF1C97A5C800A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96A71F091C718F8800C0C4AE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 96F2F1E01C97A5C800A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96A71F0E1C718F8800C0C4AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96F2F1E21C97A5C800A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96A71F111C718F8800C0C4AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96F2F1E31C97A5C800A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96A71F131C718F8800C0C4AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96F2F1E41C97A5C800A5FE27 /* 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 @@
96A71EFB1C718F8800C0C4AE = { 96A71EFB1C718F8800C0C4AE = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71F061C718F8800C0C4AE /* SearchBarView */, 96F2F1DE1C97A5C800A5FE27 /* SearchBar */,
96A71F051C718F8800C0C4AE /* Products */, 96A71F051C718F8800C0C4AE /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -57,29 +57,29 @@ ...@@ -57,29 +57,29 @@
96A71F051C718F8800C0C4AE /* Products */ = { 96A71F051C718F8800C0C4AE /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71F041C718F8800C0C4AE /* SearchBarView.app */, 96A71F041C718F8800C0C4AE /* SearchBar.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96A71F061C718F8800C0C4AE /* SearchBarView */ = { 96F2F1DE1C97A5C800A5FE27 /* SearchBar */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71F071C718F8800C0C4AE /* AppDelegate.swift */, 96F2F1DF1C97A5C800A5FE27 /* AppDelegate.swift */,
96A71F091C718F8800C0C4AE /* ViewController.swift */, 96F2F1E41C97A5C800A5FE27 /* ViewController.swift */,
96A71F0E1C718F8800C0C4AE /* Assets.xcassets */, 96F2F1E01C97A5C800A5FE27 /* Assets.xcassets */,
96A71F101C718F8800C0C4AE /* LaunchScreen.storyboard */, 96F2F1E11C97A5C800A5FE27 /* LaunchScreen.storyboard */,
96A71F131C718F8800C0C4AE /* Info.plist */, 96F2F1E31C97A5C800A5FE27 /* Info.plist */,
); );
path = SearchBarView; path = SearchBar;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
96A71F031C718F8800C0C4AE /* SearchBarView */ = { 96A71F031C718F8800C0C4AE /* SearchBar */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 96A71F161C718F8800C0C4AE /* Build configuration list for PBXNativeTarget "SearchBarView" */; buildConfigurationList = 96A71F161C718F8800C0C4AE /* Build configuration list for PBXNativeTarget "SearchBar" */;
buildPhases = ( buildPhases = (
96A71F001C718F8800C0C4AE /* Sources */, 96A71F001C718F8800C0C4AE /* Sources */,
96A71F011C718F8800C0C4AE /* Frameworks */, 96A71F011C718F8800C0C4AE /* Frameworks */,
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
); );
dependencies = ( dependencies = (
); );
name = SearchBarView; name = SearchBar;
productName = SearchBarView; productName = SearchBarView;
productReference = 96A71F041C718F8800C0C4AE /* SearchBarView.app */; productReference = 96A71F041C718F8800C0C4AE /* SearchBar.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 = 96A71EFF1C718F8800C0C4AE /* Build configuration list for PBXProject "SearchBarView" */; buildConfigurationList = 96A71EFF1C718F8800C0C4AE /* Build configuration list for PBXProject "SearchBar" */;
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 = (
96A71F031C718F8800C0C4AE /* SearchBarView */, 96A71F031C718F8800C0C4AE /* SearchBar */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
...@@ -133,8 +133,8 @@ ...@@ -133,8 +133,8 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96A71F121C718F8800C0C4AE /* LaunchScreen.storyboard in Resources */, 96F2F1E61C97A5C800A5FE27 /* Assets.xcassets in Resources */,
96A71F0F1C718F8800C0C4AE /* Assets.xcassets in Resources */, 96F2F1E71C97A5C800A5FE27 /* 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 = (
96A71F0A1C718F8800C0C4AE /* ViewController.swift in Sources */, 96F2F1E91C97A5C800A5FE27 /* ViewController.swift in Sources */,
96A71F081C718F8800C0C4AE /* AppDelegate.swift in Sources */, 96F2F1E51C97A5C800A5FE27 /* AppDelegate.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
96A71F101C718F8800C0C4AE /* LaunchScreen.storyboard */ = { 96F2F1E11C97A5C800A5FE27 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
96A71F111C718F8800C0C4AE /* Base */, 96F2F1E21C97A5C800A5FE27 /* 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 = SearchBarView/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/SearchBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBarView; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBar;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = SearchBar;
}; };
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 = SearchBarView/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/SearchBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBarView; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBar;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = SearchBar;
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
96A71EFF1C718F8800C0C4AE /* Build configuration list for PBXProject "SearchBarView" */ = { 96A71EFF1C718F8800C0C4AE /* Build configuration list for PBXProject "SearchBar" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
96A71F141C718F8800C0C4AE /* Debug */, 96A71F141C718F8800C0C4AE /* Debug */,
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
96A71F161C718F8800C0C4AE /* Build configuration list for PBXNativeTarget "SearchBarView" */ = { 96A71F161C718F8800C0C4AE /* Build configuration list for PBXNativeTarget "SearchBar" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
96A71F171C718F8800C0C4AE /* Debug */, 96A71F171C718F8800C0C4AE /* 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 SearchBarView is a fully featured SearchBar that supports orientation A SearchBar is a fully featured SearchBar that supports orientation
changes, background images, both left and right UIControl sets, and status bar changes, background images, both left and right UIControl sets, and status bar
settings. Below is an example of its usage. 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 SearchBarView. /// Reference for SearchBar.
private var searchBarView: SearchBarView = SearchBarView() private var searchBar: SearchBar = SearchBar()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepareView()
prepareSearchBarView() prepareSearchBar()
} }
/// 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
} }
/// Prepare navigationBarView. /// Prepare toolbar.
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()
...@@ -89,18 +89,18 @@ class ViewController: UIViewController { ...@@ -89,18 +89,18 @@ 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.
*/ */
searchBarView.statusBarStyle = .Default searchBar.statusBarStyle = .Default
searchBarView.placeholder = "Search" searchBar.placeholder = "Search"
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBar.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4 searchBar.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4 searchBar.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regular searchBar.textField.font = RobotoFont.regular
searchBarView.clearButton = clearButton searchBar.clearButton = clearButton
searchBarView.leftControls = [backButton] searchBar.leftControls = [backButton]
searchBarView.rightControls = [switchControl, moreButton] searchBar.rightControls = [switchControl, moreButton]
view.addSubview(searchBarView) view.addSubview(searchBar)
} }
} }
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
960036011C77E0D400EBA579 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960036001C77E0D400EBA579 /* AppDelegate.swift */; }; 96F2F1F41C97A60800A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1EB1C97A60800A5FE27 /* AppDelegate.swift */; };
960036031C77E0D400EBA579 /* AppSearchBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960036021C77E0D400EBA579 /* AppSearchBarViewController.swift */; }; 96F2F1F51C97A60800A5FE27 /* AppSearchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1EC1C97A60800A5FE27 /* AppSearchBarController.swift */; };
960036081C77E0D400EBA579 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 960036071C77E0D400EBA579 /* Assets.xcassets */; }; 96F2F1F61C97A60800A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1ED1C97A60800A5FE27 /* Assets.xcassets */; };
9600360B1C77E0D400EBA579 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 960036091C77E0D400EBA579 /* LaunchScreen.storyboard */; }; 96F2F1F71C97A60800A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1EE1C97A60800A5FE27 /* LaunchScreen.storyboard */; };
960036131C77E13D00EBA579 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960036121C77E13D00EBA579 /* YellowViewController.swift */; }; 96F2F1F81C97A60800A5FE27 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1F01C97A60800A5FE27 /* BlueViewController.swift */; };
9663F91F1C7A6E3D00AF0965 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F91E1C7A6E3D00AF0965 /* BlueViewController.swift */; }; 96F2F1F91C97A60800A5FE27 /* GreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1F11C97A60800A5FE27 /* GreenViewController.swift */; };
9663F9211C7A6E4800AF0965 /* GreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9201C7A6E4800AF0965 /* GreenViewController.swift */; }; 96F2F1FB1C97A60800A5FE27 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1F31C97A60800A5FE27 /* YellowViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
960035FD1C77E0D400EBA579 /* SearchBarViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchBarViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 960035FD1C77E0D400EBA579 /* SearchBarController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchBarController.app; sourceTree = BUILT_PRODUCTS_DIR; };
960036001C77E0D400EBA579 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96F2F1EB1C97A60800A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
960036021C77E0D400EBA579 /* AppSearchBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSearchBarViewController.swift; sourceTree = "<group>"; }; 96F2F1EC1C97A60800A5FE27 /* AppSearchBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppSearchBarController.swift; sourceTree = "<group>"; };
960036071C77E0D400EBA579 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96F2F1ED1C97A60800A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9600360A1C77E0D400EBA579 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96F2F1EF1C97A60800A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9600360C1C77E0D400EBA579 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96F2F1F01C97A60800A5FE27 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; };
960036121C77E13D00EBA579 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; }; 96F2F1F11C97A60800A5FE27 /* GreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewController.swift; sourceTree = "<group>"; };
9663F91E1C7A6E3D00AF0965 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; }; 96F2F1F21C97A60800A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9663F9201C7A6E4800AF0965 /* GreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewController.swift; sourceTree = "<group>"; }; 96F2F1F31C97A60800A5FE27 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
960035F41C77E0D400EBA579 = { 960035F41C77E0D400EBA579 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
960035FF1C77E0D400EBA579 /* SearchBarViewController */, 96F2F1EA1C97A60800A5FE27 /* SearchBarController */,
960035FE1C77E0D400EBA579 /* Products */, 960035FE1C77E0D400EBA579 /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -63,32 +63,32 @@ ...@@ -63,32 +63,32 @@
960035FE1C77E0D400EBA579 /* Products */ = { 960035FE1C77E0D400EBA579 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
960035FD1C77E0D400EBA579 /* SearchBarViewController.app */, 960035FD1C77E0D400EBA579 /* SearchBarController.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
960035FF1C77E0D400EBA579 /* SearchBarViewController */ = { 96F2F1EA1C97A60800A5FE27 /* SearchBarController */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
960036001C77E0D400EBA579 /* AppDelegate.swift */, 96F2F1EB1C97A60800A5FE27 /* AppDelegate.swift */,
960036021C77E0D400EBA579 /* AppSearchBarViewController.swift */, 96F2F1EC1C97A60800A5FE27 /* AppSearchBarController.swift */,
960036121C77E13D00EBA579 /* YellowViewController.swift */, 96F2F1F01C97A60800A5FE27 /* BlueViewController.swift */,
9663F91E1C7A6E3D00AF0965 /* BlueViewController.swift */, 96F2F1F11C97A60800A5FE27 /* GreenViewController.swift */,
9663F9201C7A6E4800AF0965 /* GreenViewController.swift */, 96F2F1F31C97A60800A5FE27 /* YellowViewController.swift */,
960036071C77E0D400EBA579 /* Assets.xcassets */, 96F2F1ED1C97A60800A5FE27 /* Assets.xcassets */,
960036091C77E0D400EBA579 /* LaunchScreen.storyboard */, 96F2F1EE1C97A60800A5FE27 /* LaunchScreen.storyboard */,
9600360C1C77E0D400EBA579 /* Info.plist */, 96F2F1F21C97A60800A5FE27 /* Info.plist */,
); );
path = SearchBarViewController; path = SearchBarController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
960035FC1C77E0D400EBA579 /* SearchBarViewController */ = { 960035FC1C77E0D400EBA579 /* SearchBarController */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 9600360F1C77E0D400EBA579 /* Build configuration list for PBXNativeTarget "SearchBarViewController" */; buildConfigurationList = 9600360F1C77E0D400EBA579 /* Build configuration list for PBXNativeTarget "SearchBarController" */;
buildPhases = ( buildPhases = (
960035F91C77E0D400EBA579 /* Sources */, 960035F91C77E0D400EBA579 /* Sources */,
960035FA1C77E0D400EBA579 /* Frameworks */, 960035FA1C77E0D400EBA579 /* Frameworks */,
...@@ -99,9 +99,9 @@ ...@@ -99,9 +99,9 @@
); );
dependencies = ( dependencies = (
); );
name = SearchBarViewController; name = SearchBarController;
productName = SearchBarViewController; productName = SearchBarViewController;
productReference = 960035FD1C77E0D400EBA579 /* SearchBarViewController.app */; productReference = 960035FD1C77E0D400EBA579 /* SearchBarController.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
}; };
}; };
}; };
buildConfigurationList = 960035F81C77E0D400EBA579 /* Build configuration list for PBXProject "SearchBarViewController" */; buildConfigurationList = 960035F81C77E0D400EBA579 /* Build configuration list for PBXProject "SearchBarController" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
960035FC1C77E0D400EBA579 /* SearchBarViewController */, 960035FC1C77E0D400EBA579 /* SearchBarController */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9600360B1C77E0D400EBA579 /* LaunchScreen.storyboard in Resources */, 96F2F1F61C97A60800A5FE27 /* Assets.xcassets in Resources */,
960036081C77E0D400EBA579 /* Assets.xcassets in Resources */, 96F2F1F71C97A60800A5FE27 /* LaunchScreen.storyboard in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -154,21 +154,21 @@ ...@@ -154,21 +154,21 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
960036131C77E13D00EBA579 /* YellowViewController.swift in Sources */, 96F2F1F91C97A60800A5FE27 /* GreenViewController.swift in Sources */,
960036031C77E0D400EBA579 /* AppSearchBarViewController.swift in Sources */, 96F2F1F51C97A60800A5FE27 /* AppSearchBarController.swift in Sources */,
9663F91F1C7A6E3D00AF0965 /* BlueViewController.swift in Sources */, 96F2F1F81C97A60800A5FE27 /* BlueViewController.swift in Sources */,
960036011C77E0D400EBA579 /* AppDelegate.swift in Sources */, 96F2F1F41C97A60800A5FE27 /* AppDelegate.swift in Sources */,
9663F9211C7A6E4800AF0965 /* GreenViewController.swift in Sources */, 96F2F1FB1C97A60800A5FE27 /* YellowViewController.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
960036091C77E0D400EBA579 /* LaunchScreen.storyboard */ = { 96F2F1EE1C97A60800A5FE27 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
9600360A1C77E0D400EBA579 /* Base */, 96F2F1EF1C97A60800A5FE27 /* Base */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -263,10 +263,10 @@ ...@@ -263,10 +263,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SearchBarViewController/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/SearchBarController/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBarViewController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBarController;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = SearchBarController;
}; };
name = Debug; name = Debug;
}; };
...@@ -274,17 +274,17 @@ ...@@ -274,17 +274,17 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SearchBarViewController/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/SearchBarController/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBarViewController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SearchBarController;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = SearchBarController;
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
960035F81C77E0D400EBA579 /* Build configuration list for PBXProject "SearchBarViewController" */ = { 960035F81C77E0D400EBA579 /* Build configuration list for PBXProject "SearchBarController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9600360D1C77E0D400EBA579 /* Debug */, 9600360D1C77E0D400EBA579 /* Debug */,
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
9600360F1C77E0D400EBA579 /* Build configuration list for PBXNativeTarget "SearchBarViewController" */ = { 9600360F1C77E0D400EBA579 /* Build configuration list for PBXNativeTarget "SearchBarController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
960036101C77E0D400EBA579 /* Debug */, 960036101C77E0D400EBA579 /* Debug */,
......
...@@ -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 = AppSearchBarViewController(mainViewController: YellowViewController()) window!.rootViewController = AppSearchBarController(mainViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
} }
......
...@@ -29,21 +29,21 @@ ...@@ -29,21 +29,21 @@
*/ */
/* /*
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()
} }
/// Loads the BlueViewController into the searchBarViewControllers mainViewController. /// Loads the BlueViewController into the searchBarControllers mainViewController.
func handleBlueButton() { func handleBlueButton() {
if mainViewController is BlueViewController { if mainViewController is BlueViewController {
return return
...@@ -51,7 +51,7 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -51,7 +51,7 @@ class AppSearchBarViewController: SearchBarViewController {
transitionFromMainViewController(BlueViewController(), options: [.TransitionCrossDissolve]) transitionFromMainViewController(BlueViewController(), options: [.TransitionCrossDissolve])
} }
/// Loads the GreenViewController into the searchBarViewControllers mainViewController. /// Loads the GreenViewController into the searchBarControllers mainViewController.
func handleGreenButton() { func handleGreenButton() {
if mainViewController is GreenViewController { if mainViewController is GreenViewController {
return return
...@@ -59,13 +59,13 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -59,13 +59,13 @@ class AppSearchBarViewController: SearchBarViewController {
transitionFromMainViewController(GreenViewController(), options: [.TransitionCrossDissolve]) transitionFromMainViewController(GreenViewController(), options: [.TransitionCrossDissolve])
} }
/// Loads the YellowViewController into the searchBarViewControllers mainViewController. /// Loads the YellowViewController into the searchBarControllers mainViewController.
func handleYellowButton() { func handleYellowButton() {
if (mainViewController as? NavigationBarViewController)?.mainViewController is YellowViewController { if (mainViewController as? ToolbarController)?.mainViewController is YellowViewController {
return return
} }
transitionFromMainViewController(YellowViewController(), options: [.TransitionCrossDissolve]) transitionFromMainViewController(YellowViewController(), options: [.TransitionCrossDissolve])
searchBarView.textField.resignFirstResponder() searchBar.textField.resignFirstResponder()
} }
/// Prepares view. /// Prepares view.
...@@ -74,8 +74,8 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -74,8 +74,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()
...@@ -111,22 +111,22 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -111,22 +111,22 @@ class AppSearchBarViewController: SearchBarViewController {
"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.
*/ */
searchBarView.statusBarStyle = .Default searchBar.statusBarStyle = .Default
searchBarView.placeholder = "Search" searchBar.placeholder = "Search"
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBar.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4 searchBar.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4 searchBar.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regular searchBar.textField.font = RobotoFont.regular
searchBarView.textField.delegate = self searchBar.textField.delegate = self
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) {
mainViewController.view.alpha = 0.5 mainViewController.view.alpha = 0.5
mainViewController.view.userInteractionEnabled = false mainViewController.view.userInteractionEnabled = false
......
...@@ -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>
...@@ -43,5 +41,7 @@ ...@@ -43,5 +41,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict> </dict>
</plist> </plist>
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
9663F9691C7ADCB600AF0965 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9681C7ADCB600AF0965 /* AppDelegate.swift */; }; 96F2F2051C97A68800A5FE27 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F1FD1C97A68800A5FE27 /* AppDelegate.swift */; };
9663F9701C7ADCB600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F96F1C7ADCB600AF0965 /* Assets.xcassets */; }; 96F2F2061C97A68800A5FE27 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1FE1C97A68800A5FE27 /* Assets.xcassets */; };
9663F9731C7ADCB600AF0965 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9711C7ADCB600AF0965 /* LaunchScreen.storyboard */; }; 96F2F2071C97A68800A5FE27 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F2F1FF1C97A68800A5FE27 /* LaunchScreen.storyboard */; };
9663F97B1C7ADD0B00AF0965 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F97A1C7ADD0B00AF0965 /* YellowViewController.swift */; }; 96F2F2081C97A68800A5FE27 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2011C97A68800A5FE27 /* BlueViewController.swift */; };
9663F97D1C7ADD1400AF0965 /* BlueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F97C1C7ADD1400AF0965 /* BlueViewController.swift */; }; 96F2F2091C97A68800A5FE27 /* GreenViewcontroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2021C97A68800A5FE27 /* GreenViewcontroller.swift */; };
9663F97F1C7ADD1F00AF0965 /* GreenViewcontroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F97E1C7ADD1F00AF0965 /* GreenViewcontroller.swift */; }; 96F2F20B1C97A68800A5FE27 /* YellowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F2F2041C97A68800A5FE27 /* YellowViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9663F9651C7ADCB600AF0965 /* SideNavigationViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigationViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9663F9651C7ADCB600AF0965 /* SideNavigationController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigationController.app; sourceTree = BUILT_PRODUCTS_DIR; };
9663F9681C7ADCB600AF0965 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96F2F1FD1C97A68800A5FE27 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9663F96F1C7ADCB600AF0965 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96F2F1FE1C97A68800A5FE27 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9663F9721C7ADCB600AF0965 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96F2F2001C97A68800A5FE27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9663F9741C7ADCB600AF0965 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96F2F2011C97A68800A5FE27 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; };
9663F97A1C7ADD0B00AF0965 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; }; 96F2F2021C97A68800A5FE27 /* GreenViewcontroller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewcontroller.swift; sourceTree = "<group>"; };
9663F97C1C7ADD1400AF0965 /* BlueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlueViewController.swift; sourceTree = "<group>"; }; 96F2F2031C97A68800A5FE27 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9663F97E1C7ADD1F00AF0965 /* GreenViewcontroller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenViewcontroller.swift; sourceTree = "<group>"; }; 96F2F2041C97A68800A5FE27 /* YellowViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YellowViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
9663F95C1C7ADCB600AF0965 = { 9663F95C1C7ADCB600AF0965 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9663F9671C7ADCB600AF0965 /* SideNavigationViewController */, 96F2F1FC1C97A68800A5FE27 /* SideNavigationController */,
9663F9661C7ADCB600AF0965 /* Products */, 9663F9661C7ADCB600AF0965 /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -61,31 +61,31 @@ ...@@ -61,31 +61,31 @@
9663F9661C7ADCB600AF0965 /* Products */ = { 9663F9661C7ADCB600AF0965 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9663F9651C7ADCB600AF0965 /* SideNavigationViewController.app */, 9663F9651C7ADCB600AF0965 /* SideNavigationController.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9663F9671C7ADCB600AF0965 /* SideNavigationViewController */ = { 96F2F1FC1C97A68800A5FE27 /* SideNavigationController */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9663F9681C7ADCB600AF0965 /* AppDelegate.swift */, 96F2F1FD1C97A68800A5FE27 /* AppDelegate.swift */,
9663F97A1C7ADD0B00AF0965 /* YellowViewController.swift */, 96F2F2011C97A68800A5FE27 /* BlueViewController.swift */,
9663F97C1C7ADD1400AF0965 /* BlueViewController.swift */, 96F2F2021C97A68800A5FE27 /* GreenViewcontroller.swift */,
9663F97E1C7ADD1F00AF0965 /* GreenViewcontroller.swift */, 96F2F2041C97A68800A5FE27 /* YellowViewController.swift */,
9663F96F1C7ADCB600AF0965 /* Assets.xcassets */, 96F2F1FE1C97A68800A5FE27 /* Assets.xcassets */,
9663F9711C7ADCB600AF0965 /* LaunchScreen.storyboard */, 96F2F1FF1C97A68800A5FE27 /* LaunchScreen.storyboard */,
9663F9741C7ADCB600AF0965 /* Info.plist */, 96F2F2031C97A68800A5FE27 /* Info.plist */,
); );
path = SideNavigationViewController; path = SideNavigationController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
9663F9641C7ADCB600AF0965 /* SideNavigationViewController */ = { 9663F9641C7ADCB600AF0965 /* SideNavigationController */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 9663F9771C7ADCB600AF0965 /* Build configuration list for PBXNativeTarget "SideNavigationViewController" */; buildConfigurationList = 9663F9771C7ADCB600AF0965 /* Build configuration list for PBXNativeTarget "SideNavigationController" */;
buildPhases = ( buildPhases = (
9663F9611C7ADCB600AF0965 /* Sources */, 9663F9611C7ADCB600AF0965 /* Sources */,
9663F9621C7ADCB600AF0965 /* Frameworks */, 9663F9621C7ADCB600AF0965 /* Frameworks */,
...@@ -96,9 +96,9 @@ ...@@ -96,9 +96,9 @@
); );
dependencies = ( dependencies = (
); );
name = SideNavigationViewController; name = SideNavigationController;
productName = SideNavigationViewController; productName = SideNavigationViewController;
productReference = 9663F9651C7ADCB600AF0965 /* SideNavigationViewController.app */; productReference = 9663F9651C7ADCB600AF0965 /* SideNavigationController.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
}; };
}; };
}; };
buildConfigurationList = 9663F9601C7ADCB600AF0965 /* Build configuration list for PBXProject "SideNavigationViewController" */; buildConfigurationList = 9663F9601C7ADCB600AF0965 /* Build configuration list for PBXProject "SideNavigationController" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
9663F9641C7ADCB600AF0965 /* SideNavigationViewController */, 9663F9641C7ADCB600AF0965 /* SideNavigationController */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
...@@ -139,8 +139,8 @@ ...@@ -139,8 +139,8 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9663F9731C7ADCB600AF0965 /* LaunchScreen.storyboard in Resources */, 96F2F2061C97A68800A5FE27 /* Assets.xcassets in Resources */,
9663F9701C7ADCB600AF0965 /* Assets.xcassets in Resources */, 96F2F2071C97A68800A5FE27 /* LaunchScreen.storyboard in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -151,20 +151,20 @@ ...@@ -151,20 +151,20 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9663F97F1C7ADD1F00AF0965 /* GreenViewcontroller.swift in Sources */, 96F2F20B1C97A68800A5FE27 /* YellowViewController.swift in Sources */,
9663F97B1C7ADD0B00AF0965 /* YellowViewController.swift in Sources */, 96F2F2081C97A68800A5FE27 /* BlueViewController.swift in Sources */,
9663F97D1C7ADD1400AF0965 /* BlueViewController.swift in Sources */, 96F2F2051C97A68800A5FE27 /* AppDelegate.swift in Sources */,
9663F9691C7ADCB600AF0965 /* AppDelegate.swift in Sources */, 96F2F2091C97A68800A5FE27 /* GreenViewcontroller.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
9663F9711C7ADCB600AF0965 /* LaunchScreen.storyboard */ = { 96F2F1FF1C97A68800A5FE27 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
9663F9721C7ADCB600AF0965 /* Base */, 96F2F2001C97A68800A5FE27 /* Base */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -259,10 +259,10 @@ ...@@ -259,10 +259,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SideNavigationViewController/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/SideNavigationController/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationViewController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationController;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = SideNavigationController;
}; };
name = Debug; name = Debug;
}; };
...@@ -270,17 +270,17 @@ ...@@ -270,17 +270,17 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SideNavigationViewController/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/SideNavigationController/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationViewController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.SideNavigationController;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = SideNavigationController;
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
9663F9601C7ADCB600AF0965 /* Build configuration list for PBXProject "SideNavigationViewController" */ = { 9663F9601C7ADCB600AF0965 /* Build configuration list for PBXProject "SideNavigationController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9663F9751C7ADCB600AF0965 /* Debug */, 9663F9751C7ADCB600AF0965 /* Debug */,
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
9663F9771C7ADCB600AF0965 /* Build configuration list for PBXNativeTarget "SideNavigationViewController" */ = { 9663F9771C7ADCB600AF0965 /* Build configuration list for PBXNativeTarget "SideNavigationController" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
9663F9781C7ADCB600AF0965 /* Debug */, 9663F9781C7ADCB600AF0965 /* Debug */,
......
...@@ -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: YellowViewController(), leftViewController: GreenViewController(), rightViewController: BlueViewController()) window!.rootViewController = SideNavigationController(mainViewController: YellowViewController(), leftViewController: GreenViewController(), rightViewController: BlueViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
} }
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies> <dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies> </dependencies>
<scenes> <scenes>
...@@ -17,7 +16,7 @@ ...@@ -17,7 +16,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="est-za-GAc" customClass="NavigationBarView" customModule="Material"> <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="est-za-GAc" customClass="Toolbar" customModule="Material">
<rect key="frame" x="0.0" y="0.0" width="600" height="64"/> <rect key="frame" x="0.0" y="0.0" width="600" height="64"/>
<color key="backgroundColor" red="0.39222975830000001" green="0.2440954615" blue="0.68699765469999996" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.39222975830000001" green="0.2440954615" blue="0.68699765469999996" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
...@@ -32,8 +31,8 @@ ...@@ -32,8 +31,8 @@
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="navigationBarView" destination="est-za-GAc" id="3ly-Ta-1qf"/> <outlet property="toolbar" destination="est-za-GAc" id="3ly-Ta-1qf"/>
<outlet property="navigationBarViewHeightConstraint" destination="dve-99-fA0" id="hkR-r9-Oc3"/> <outlet property="toolbarHeightConstraint" destination="dve-99-fA0" id="hkR-r9-Oc3"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
......
...@@ -33,28 +33,28 @@ import Material ...@@ -33,28 +33,28 @@ import Material
class ViewController: UIViewController { class ViewController: UIViewController {
@IBOutlet weak var navigationBarView: NavigationBarView! @IBOutlet weak var toolbar: Toolbar!
@IBOutlet weak var navigationBarViewHeightConstraint: NSLayoutConstraint? @IBOutlet weak var toolbarHeightConstraint: NSLayoutConstraint?
override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
// If landscape. // If landscape.
if UIInterfaceOrientationIsLandscape(toInterfaceOrientation) { if UIInterfaceOrientationIsLandscape(toInterfaceOrientation) {
/** /**
The height of the NavigationBarView is dependant on the device being used. The height of the Toolbar is dependant on the device being used.
If the device is an iPad, the height should stay the same as in Portrait If the device is an iPad, the height should stay the same as in Portrait
view, otherwise it should strink to the Landscape height for iPhone. view, otherwise it should strink to the Landscape height for iPhone.
*/ */
navigationBarViewHeightConstraint?.constant = .iPad == MaterialDevice.type ? navigationBarView!.heightForPortraitOrientation : navigationBarView!.heightForLandscapeOrientation toolbarHeightConstraint?.constant = .iPad == MaterialDevice.type ? toolbar!.heightForPortraitOrientation : toolbar!.heightForLandscapeOrientation
} else { } else {
navigationBarViewHeightConstraint?.constant = navigationBarView!.heightForPortraitOrientation toolbarHeightConstraint?.constant = toolbar!.heightForPortraitOrientation
} }
} }
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepareView()
prepareNavigationBarView() prepareToolbar()
} }
/// General preparation statements. /// General preparation statements.
...@@ -62,14 +62,14 @@ class ViewController: UIViewController { ...@@ -62,14 +62,14 @@ class ViewController: UIViewController {
view.backgroundColor = MaterialColor.white view.backgroundColor = MaterialColor.white
} }
/// Prepare the navigationBarView. /// Prepare the toolbar.
func prepareNavigationBarView() { func prepareToolbar() {
// Stylize. // Stylize.
navigationBarView.backgroundColor = MaterialColor.indigo.darken1 toolbar.backgroundColor = MaterialColor.indigo.darken1
// To lighten the status bar add the "View controller-based status bar appearance = NO" // To lighten the status bar add the "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
// Title label. // Title label.
let titleLabel: UILabel = UILabel() let titleLabel: UILabel = UILabel()
...@@ -77,7 +77,7 @@ class ViewController: UIViewController { ...@@ -77,7 +77,7 @@ class ViewController: UIViewController {
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
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()
...@@ -85,7 +85,7 @@ class ViewController: UIViewController { ...@@ -85,7 +85,7 @@ class ViewController: UIViewController {
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
// Menu button. // Menu button.
let img1: UIImage? = UIImage(named: "ic_menu_white") let img1: UIImage? = UIImage(named: "ic_menu_white")
...@@ -109,10 +109,10 @@ class ViewController: UIViewController { ...@@ -109,10 +109,10 @@ class ViewController: UIViewController {
btn3.setImage(img3, forState: .Highlighted) btn3.setImage(img3, forState: .Highlighted)
// Add buttons to left side. // Add buttons to left side.
navigationBarView.leftControls = [btn1] toolbar.leftControls = [btn1]
// Add buttons to right side. // Add buttons to right side.
navigationBarView.rightControls = [btn2, btn3] toolbar.rightControls = [btn2, btn3]
} }
} }
...@@ -43,9 +43,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -43,9 +43,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let mainViewController = storyboard.instantiateViewControllerWithIdentifier("MainViewController") as! MainViewController let mainViewController = storyboard.instantiateViewControllerWithIdentifier("MainViewController") as! MainViewController
let sideViewController = storyboard.instantiateViewControllerWithIdentifier("SideViewController") as! SideViewController let sideViewController = storyboard.instantiateViewControllerWithIdentifier("SideViewController") as! SideViewController
// Configure the window with the SideNavigationViewController as the root view controller // Configure the window with the SideNavigationController as the root view controller
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = SideNavigationViewController(mainViewController: mainViewController, leftViewController: sideViewController) window?.rootViewController = SideNavigationController(mainViewController: mainViewController, leftViewController: sideViewController)
window?.makeKeyAndVisible() window?.makeKeyAndVisible()
return true return true
} }
......
...@@ -36,7 +36,7 @@ class MainViewController: UIViewController { ...@@ -36,7 +36,7 @@ class MainViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib. // Do any additional setup after loading the view, typically from a nib.
// Toggle SideNavigationViewController. // Toggle SideNavigationController.
let img: UIImage? = UIImage(named: "ic_create_white") let img: UIImage? = UIImage(named: "ic_create_white")
let fabButton: FabButton = FabButton() let fabButton: FabButton = FabButton()
fabButton.setImage(img, forState: .Normal) fabButton.setImage(img, forState: .Normal)
...@@ -51,7 +51,7 @@ class MainViewController: UIViewController { ...@@ -51,7 +51,7 @@ class MainViewController: UIViewController {
// FabButton handler. // FabButton handler.
func handleFabButton() { func handleFabButton() {
sideNavigationViewController?.toggleLeftView() sideNavigationController?.toggleLeftView()
} }
} }
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.36.1' s.version = '1.37.0'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.' s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
65FDC2EB1C66858A00103AC2 /* Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FDC2EA1C66858A00103AC2 /* Menu.swift */; }; 65FDC2EB1C66858A00103AC2 /* Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FDC2EA1C66858A00103AC2 /* Menu.swift */; };
960036151C77E1B600EBA579 /* SearchBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960036141C77E1B600EBA579 /* SearchBarViewController.swift */; }; 960036151C77E1B600EBA579 /* SearchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960036141C77E1B600EBA579 /* SearchBarController.swift */; };
960B23271C383E5500E96216 /* Material+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960B23261C383E5500E96216 /* Material+String.swift */; }; 960B23271C383E5500E96216 /* Material+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960B23261C383E5500E96216 /* Material+String.swift */; };
960B232E1C383EAA00E96216 /* Material+UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960B23281C383EAA00E96216 /* Material+UIImage.swift */; }; 960B232E1C383EAA00E96216 /* Material+UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960B23281C383EAA00E96216 /* Material+UIImage.swift */; };
960B232F1C383EAA00E96216 /* Material+UIImage+Crop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960B23291C383EAA00E96216 /* Material+UIImage+Crop.swift */; }; 960B232F1C383EAA00E96216 /* Material+UIImage+Crop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960B23291C383EAA00E96216 /* Material+UIImage+Crop.swift */; };
...@@ -50,15 +50,17 @@ ...@@ -50,15 +50,17 @@
9656264A1C8757B4004ADEF7 /* MaterialDataSourceItem.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC08901C7FEC170034FF84 /* MaterialDataSourceItem.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 9656264A1C8757B4004ADEF7 /* MaterialDataSourceItem.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC08901C7FEC170034FF84 /* MaterialDataSourceItem.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9656CD0C1C6BD33700EBCEF1 /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */; }; 9656CD0C1C6BD33700EBCEF1 /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */; };
966F57B81C226D75009185B7 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57B71C226D75009185B7 /* TextField.swift */; }; 966F57B81C226D75009185B7 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57B71C226D75009185B7 /* TextField.swift */; };
968F16F61C9260EC008CA3F6 /* NavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F16F51C9260EC008CA3F6 /* NavigationBarView.swift */; }; 967887871C9775900037F6C9 /* NavigationItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967887861C9775900037F6C9 /* NavigationItem.swift */; };
968F16F81C92612E008CA3F6 /* NavigationBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F16F71C92612E008CA3F6 /* NavigationBarViewController.swift */; }; 967887891C9777CB0037F6C9 /* MaterialViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967887881C9777CB0037F6C9 /* MaterialViewTests.swift */; };
968F16F61C9260EC008CA3F6 /* Toolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F16F51C9260EC008CA3F6 /* Toolbar.swift */; };
968F16F81C92612E008CA3F6 /* ToolbarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F16F71C92612E008CA3F6 /* ToolbarController.swift */; };
968F17171C9266D0008CA3F6 /* MaterialIcon.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BE340E1C8E68EF007D02BE /* MaterialIcon.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F17171C9266D0008CA3F6 /* MaterialIcon.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BE340E1C8E68EF007D02BE /* MaterialIcon.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F17181C9266D0008CA3F6 /* Material+Obj-C.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334F021C8BA14C0083986B /* Material+Obj-C.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F17181C9266D0008CA3F6 /* Material+Obj-C.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334F021C8BA14C0083986B /* Material+Obj-C.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F17191C9266D0008CA3F6 /* Material+UIImage+Blank.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334F001C8B8BD30083986B /* Material+UIImage+Blank.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F17191C9266D0008CA3F6 /* Material+UIImage+Blank.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334F001C8B8BD30083986B /* Material+UIImage+Blank.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F171A1C9266D0008CA3F6 /* NavigationBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334EF71C8B84880083986B /* NavigationBar.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F171A1C9266D0008CA3F6 /* NavigationBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334EF71C8B84880083986B /* NavigationBar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F171B1C9266D0008CA3F6 /* NavigationController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334EF91C8B849A0083986B /* NavigationController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F171B1C9266D0008CA3F6 /* NavigationController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96334EF91C8B849A0083986B /* NavigationController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F171C1C9266D0008CA3F6 /* NavigationBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F16F51C9260EC008CA3F6 /* NavigationBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F171C1C9266D0008CA3F6 /* Toolbar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F16F51C9260EC008CA3F6 /* Toolbar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F171D1C9266D0008CA3F6 /* NavigationBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F16F71C92612E008CA3F6 /* NavigationBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 968F171D1C9266D0008CA3F6 /* ToolbarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F16F71C92612E008CA3F6 /* ToolbarController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F17221C94B10B008CA3F6 /* MaterialPulseAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */; }; 968F17221C94B10B008CA3F6 /* MaterialPulseAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */; };
96A71E911C6FBC2200C0C4AE /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; }; 96A71E911C6FBC2200C0C4AE /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; };
96A71EB81C6FCFA300C0C4AE /* Material+UIImage+Color.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96DBA7351C61198400844821 /* Material+UIImage+Color.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96A71EB81C6FCFA300C0C4AE /* Material+UIImage+Color.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96DBA7351C61198400844821 /* Material+UIImage+Color.swift */; settings = {ATTRIBUTES = (Public, ); }; };
...@@ -66,7 +68,7 @@ ...@@ -66,7 +68,7 @@
96A71EBA1C6FCFA300C0C4AE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 65FDC2EA1C66858A00103AC2 /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96A71EBA1C6FCFA300C0C4AE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 65FDC2EA1C66858A00103AC2 /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EBB1C6FCFA300C0C4AE /* MenuView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96A71EBB1C6FCFA300C0C4AE /* MenuView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */; }; 96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */; };
96A71EF61C71127100C0C4AE /* SearchBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EF51C71127100C0C4AE /* SearchBarView.swift */; }; 96A71EF61C71127100C0C4AE /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EF51C71127100C0C4AE /* SearchBar.swift */; };
96A71F451C74ABCB00C0C4AE /* MaterialBorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F441C74ABCB00C0C4AE /* MaterialBorder.swift */; }; 96A71F451C74ABCB00C0C4AE /* MaterialBorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F441C74ABCB00C0C4AE /* MaterialBorder.swift */; };
96A71FB31C764E3200C0C4AE /* StatusBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */; }; 96A71FB31C764E3200C0C4AE /* StatusBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */; };
96A71FB61C7651AA00C0C4AE /* ControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FB01C7649F800C0C4AE /* ControlView.swift */; }; 96A71FB61C7651AA00C0C4AE /* ControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71FB01C7649F800C0C4AE /* ControlView.swift */; };
...@@ -76,8 +78,8 @@ ...@@ -76,8 +78,8 @@
96CC08331C7CCB7C0034FF84 /* MaterialSwitch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96CC08331C7CCB7C0034FF84 /* MaterialSwitch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08341C7CCB7C0034FF84 /* ControlView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71FB01C7649F800C0C4AE /* ControlView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96CC08341C7CCB7C0034FF84 /* ControlView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71FB01C7649F800C0C4AE /* ControlView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08351C7CCB7C0034FF84 /* StatusBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96CC08351C7CCB7C0034FF84 /* StatusBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08361C7CCB7C0034FF84 /* SearchBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71EF51C71127100C0C4AE /* SearchBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96CC08361C7CCB7C0034FF84 /* SearchBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71EF51C71127100C0C4AE /* SearchBar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08371C7CCB7C0034FF84 /* SearchBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960036141C77E1B600EBA579 /* SearchBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96CC08371C7CCB7C0034FF84 /* SearchBarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960036141C77E1B600EBA579 /* SearchBarController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC083D1C7CF9D40034FF84 /* StatusBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC083C1C7CF9D40034FF84 /* StatusBarViewController.swift */; }; 96CC083D1C7CF9D40034FF84 /* StatusBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC083C1C7CF9D40034FF84 /* StatusBarViewController.swift */; };
96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC083C1C7CF9D40034FF84 /* StatusBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC083C1C7CF9D40034FF84 /* StatusBarViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96CC08921C7FEC170034FF84 /* MaterialCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC088B1C7FEC170034FF84 /* MaterialCollectionView.swift */; }; 96CC08921C7FEC170034FF84 /* MaterialCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC088B1C7FEC170034FF84 /* MaterialCollectionView.swift */; };
...@@ -166,7 +168,7 @@ ...@@ -166,7 +168,7 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
65FDC2EA1C66858A00103AC2 /* Menu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Menu.swift; sourceTree = "<group>"; }; 65FDC2EA1C66858A00103AC2 /* Menu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Menu.swift; sourceTree = "<group>"; };
960036141C77E1B600EBA579 /* SearchBarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarViewController.swift; sourceTree = "<group>"; }; 960036141C77E1B600EBA579 /* SearchBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarController.swift; sourceTree = "<group>"; };
960B23261C383E5500E96216 /* Material+String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+String.swift"; sourceTree = "<group>"; }; 960B23261C383E5500E96216 /* Material+String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+String.swift"; sourceTree = "<group>"; };
960B23281C383EAA00E96216 /* Material+UIImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIImage.swift"; sourceTree = "<group>"; }; 960B23281C383EAA00E96216 /* Material+UIImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIImage.swift"; sourceTree = "<group>"; };
960B23291C383EAA00E96216 /* Material+UIImage+Crop.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIImage+Crop.swift"; sourceTree = "<group>"; }; 960B23291C383EAA00E96216 /* Material+UIImage+Crop.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIImage+Crop.swift"; sourceTree = "<group>"; };
...@@ -190,12 +192,14 @@ ...@@ -190,12 +192,14 @@
965626411C874FAE004ADEF7 /* MaterialDevice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDevice.swift; sourceTree = "<group>"; }; 965626411C874FAE004ADEF7 /* MaterialDevice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDevice.swift; sourceTree = "<group>"; };
9656CD0B1C6BD33700EBCEF1 /* Grid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = "<group>"; }; 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = "<group>"; };
966F57B71C226D75009185B7 /* TextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; }; 966F57B71C226D75009185B7 /* TextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; };
968F16F51C9260EC008CA3F6 /* NavigationBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationBarView.swift; sourceTree = "<group>"; }; 967887861C9775900037F6C9 /* NavigationItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationItem.swift; sourceTree = "<group>"; };
968F16F71C92612E008CA3F6 /* NavigationBarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationBarViewController.swift; sourceTree = "<group>"; }; 967887881C9777CB0037F6C9 /* MaterialViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialViewTests.swift; sourceTree = "<group>"; };
968F16F51C9260EC008CA3F6 /* Toolbar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Toolbar.swift; sourceTree = "<group>"; };
968F16F71C92612E008CA3F6 /* ToolbarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToolbarController.swift; sourceTree = "<group>"; };
968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialPulseAnimation.swift; sourceTree = "<group>"; }; 968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialPulseAnimation.swift; sourceTree = "<group>"; };
96A71E901C6FBC2200C0C4AE /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = "<group>"; }; 96A71E901C6FBC2200C0C4AE /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = "<group>"; };
96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialSwitch.swift; sourceTree = "<group>"; }; 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialSwitch.swift; sourceTree = "<group>"; };
96A71EF51C71127100C0C4AE /* SearchBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarView.swift; sourceTree = "<group>"; }; 96A71EF51C71127100C0C4AE /* SearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; };
96A71F441C74ABCB00C0C4AE /* MaterialBorder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialBorder.swift; sourceTree = "<group>"; }; 96A71F441C74ABCB00C0C4AE /* MaterialBorder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialBorder.swift; sourceTree = "<group>"; };
96A71FB01C7649F800C0C4AE /* ControlView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlView.swift; sourceTree = "<group>"; }; 96A71FB01C7649F800C0C4AE /* ControlView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlView.swift; sourceTree = "<group>"; };
96A71FB21C764E3200C0C4AE /* StatusBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusBarView.swift; sourceTree = "<group>"; }; 96A71FB21C764E3200C0C4AE /* StatusBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusBarView.swift; sourceTree = "<group>"; };
...@@ -270,10 +274,9 @@ ...@@ -270,10 +274,9 @@
9626C2DA1C794FA5007CA8E0 /* NavigationBar */ = { 9626C2DA1C794FA5007CA8E0 /* NavigationBar */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
967887861C9775900037F6C9 /* NavigationItem.swift */,
96334EF71C8B84880083986B /* NavigationBar.swift */, 96334EF71C8B84880083986B /* NavigationBar.swift */,
96334EF91C8B849A0083986B /* NavigationController.swift */, 96334EF91C8B849A0083986B /* NavigationController.swift */,
968F16F51C9260EC008CA3F6 /* NavigationBarView.swift */,
968F16F71C92612E008CA3F6 /* NavigationBarViewController.swift */,
); );
name = NavigationBar; name = NavigationBar;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -281,8 +284,8 @@ ...@@ -281,8 +284,8 @@
9626C2DB1C794FBB007CA8E0 /* SearchBar */ = { 9626C2DB1C794FBB007CA8E0 /* SearchBar */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71EF51C71127100C0C4AE /* SearchBarView.swift */, 96A71EF51C71127100C0C4AE /* SearchBar.swift */,
960036141C77E1B600EBA579 /* SearchBarViewController.swift */, 960036141C77E1B600EBA579 /* SearchBarController.swift */,
); );
name = SearchBar; name = SearchBar;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -317,6 +320,7 @@ ...@@ -317,6 +320,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
963832591B88E31A0015F710 /* Info.plist */, 963832591B88E31A0015F710 /* Info.plist */,
967887881C9777CB0037F6C9 /* MaterialViewTests.swift */,
); );
path = Tests; path = Tests;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -423,6 +427,7 @@ ...@@ -423,6 +427,7 @@
96A71E921C6FBC2900C0C4AE /* Menu */, 96A71E921C6FBC2900C0C4AE /* Menu */,
96CC08561C7E0EC00034FF84 /* ControlView */, 96CC08561C7E0EC00034FF84 /* ControlView */,
96D88C541C132A7700B91418 /* StatusBar */, 96D88C541C132A7700B91418 /* StatusBar */,
96F2F1B31C97A40600A5FE27 /* Toolbar */,
9626C2DB1C794FBB007CA8E0 /* SearchBar */, 9626C2DB1C794FBB007CA8E0 /* SearchBar */,
9626C2DA1C794FA5007CA8E0 /* NavigationBar */, 9626C2DA1C794FA5007CA8E0 /* NavigationBar */,
9626C2DC1C794FE5007CA8E0 /* SideNavigation */, 9626C2DC1C794FE5007CA8E0 /* SideNavigation */,
...@@ -578,6 +583,15 @@ ...@@ -578,6 +583,15 @@
name = Color; name = Color;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96F2F1B31C97A40600A5FE27 /* Toolbar */ = {
isa = PBXGroup;
children = (
968F16F51C9260EC008CA3F6 /* Toolbar.swift */,
968F16F71C92612E008CA3F6 /* ToolbarController.swift */,
);
name = Toolbar;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */ /* Begin PBXHeadersBuildPhase section */
...@@ -636,8 +650,8 @@ ...@@ -636,8 +650,8 @@
96CC08331C7CCB7C0034FF84 /* MaterialSwitch.swift in Headers */, 96CC08331C7CCB7C0034FF84 /* MaterialSwitch.swift in Headers */,
96CC08341C7CCB7C0034FF84 /* ControlView.swift in Headers */, 96CC08341C7CCB7C0034FF84 /* ControlView.swift in Headers */,
96CC08351C7CCB7C0034FF84 /* StatusBarView.swift in Headers */, 96CC08351C7CCB7C0034FF84 /* StatusBarView.swift in Headers */,
96CC08361C7CCB7C0034FF84 /* SearchBarView.swift in Headers */, 96CC08361C7CCB7C0034FF84 /* SearchBar.swift in Headers */,
96CC08371C7CCB7C0034FF84 /* SearchBarViewController.swift in Headers */, 96CC08371C7CCB7C0034FF84 /* SearchBarController.swift in Headers */,
96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */, 96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */,
965626431C8757B4004ADEF7 /* MaterialSpacing.swift in Headers */, 965626431C8757B4004ADEF7 /* MaterialSpacing.swift in Headers */,
965626441C8757B4004ADEF7 /* MaterialDevice.swift in Headers */, 965626441C8757B4004ADEF7 /* MaterialDevice.swift in Headers */,
...@@ -652,8 +666,8 @@ ...@@ -652,8 +666,8 @@
968F17191C9266D0008CA3F6 /* Material+UIImage+Blank.swift in Headers */, 968F17191C9266D0008CA3F6 /* Material+UIImage+Blank.swift in Headers */,
968F171A1C9266D0008CA3F6 /* NavigationBar.swift in Headers */, 968F171A1C9266D0008CA3F6 /* NavigationBar.swift in Headers */,
968F171B1C9266D0008CA3F6 /* NavigationController.swift in Headers */, 968F171B1C9266D0008CA3F6 /* NavigationController.swift in Headers */,
968F171C1C9266D0008CA3F6 /* NavigationBarView.swift in Headers */, 968F171C1C9266D0008CA3F6 /* Toolbar.swift in Headers */,
968F171D1C9266D0008CA3F6 /* NavigationBarViewController.swift in Headers */, 968F171D1C9266D0008CA3F6 /* ToolbarController.swift in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -703,7 +717,7 @@ ...@@ -703,7 +717,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftMigration = 0710; LastSwiftMigration = 0710;
LastSwiftUpdateCheck = 0710; LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0700; LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "CosmicMind, Inc."; ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = { TargetAttributes = {
...@@ -761,13 +775,13 @@ ...@@ -761,13 +775,13 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
968F16F61C9260EC008CA3F6 /* NavigationBarView.swift in Sources */, 968F16F61C9260EC008CA3F6 /* Toolbar.swift in Sources */,
96D88C3D1C1328D800B91418 /* MaterialView.swift in Sources */, 96D88C3D1C1328D800B91418 /* MaterialView.swift in Sources */,
960B23481C38480E00E96216 /* TextView.swift in Sources */, 960B23481C38480E00E96216 /* TextView.swift in Sources */,
96D88C291C1328D800B91418 /* MaterialBasicAnimation.swift in Sources */, 96D88C291C1328D800B91418 /* MaterialBasicAnimation.swift in Sources */,
96D88C3A1C1328D800B91418 /* MaterialTextLayer.swift in Sources */, 96D88C3A1C1328D800B91418 /* MaterialTextLayer.swift in Sources */,
960036151C77E1B600EBA579 /* SearchBarViewController.swift in Sources */, 960036151C77E1B600EBA579 /* SearchBarController.swift in Sources */,
96A71EF61C71127100C0C4AE /* SearchBarView.swift in Sources */, 96A71EF61C71127100C0C4AE /* SearchBar.swift in Sources */,
96D88C371C1328D800B91418 /* MaterialRadius.swift in Sources */, 96D88C371C1328D800B91418 /* MaterialRadius.swift in Sources */,
96CC08961C7FEC170034FF84 /* MaterialCollectionViewLayout.swift in Sources */, 96CC08961C7FEC170034FF84 /* MaterialCollectionViewLayout.swift in Sources */,
960B232F1C383EAA00E96216 /* Material+UIImage+Crop.swift in Sources */, 960B232F1C383EAA00E96216 /* Material+UIImage+Crop.swift in Sources */,
...@@ -787,6 +801,7 @@ ...@@ -787,6 +801,7 @@
96CC08931C7FEC170034FF84 /* MaterialCollectionViewCell.swift in Sources */, 96CC08931C7FEC170034FF84 /* MaterialCollectionViewCell.swift in Sources */,
96D88C201C1328D800B91418 /* CapturePreviewView.swift in Sources */, 96D88C201C1328D800B91418 /* CapturePreviewView.swift in Sources */,
96CC08921C7FEC170034FF84 /* MaterialCollectionView.swift in Sources */, 96CC08921C7FEC170034FF84 /* MaterialCollectionView.swift in Sources */,
967887871C9775900037F6C9 /* NavigationItem.swift in Sources */,
96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */, 96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */,
96CC08951C7FEC170034FF84 /* MaterialCollectionViewDelegate.swift in Sources */, 96CC08951C7FEC170034FF84 /* MaterialCollectionViewDelegate.swift in Sources */,
96BE340F1C8E68EF007D02BE /* MaterialIcon.swift in Sources */, 96BE340F1C8E68EF007D02BE /* MaterialIcon.swift in Sources */,
...@@ -802,7 +817,7 @@ ...@@ -802,7 +817,7 @@
96D88C1E1C1328D800B91418 /* CaptureView.swift in Sources */, 96D88C1E1C1328D800B91418 /* CaptureView.swift in Sources */,
968F17221C94B10B008CA3F6 /* MaterialPulseAnimation.swift in Sources */, 968F17221C94B10B008CA3F6 /* MaterialPulseAnimation.swift in Sources */,
96D88C2D1C1328D800B91418 /* MaterialDepth.swift in Sources */, 96D88C2D1C1328D800B91418 /* MaterialDepth.swift in Sources */,
968F16F81C92612E008CA3F6 /* NavigationBarViewController.swift in Sources */, 968F16F81C92612E008CA3F6 /* ToolbarController.swift in Sources */,
96CC08941C7FEC170034FF84 /* MaterialCollectionViewDataSource.swift in Sources */, 96CC08941C7FEC170034FF84 /* MaterialCollectionViewDataSource.swift in Sources */,
96D88C331C1328D800B91418 /* MaterialLabel.swift in Sources */, 96D88C331C1328D800B91418 /* MaterialLabel.swift in Sources */,
96D88C281C1328D800B91418 /* MaterialAnimation.swift in Sources */, 96D88C281C1328D800B91418 /* MaterialAnimation.swift in Sources */,
...@@ -837,6 +852,7 @@ ...@@ -837,6 +852,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
967887891C9777CB0037F6C9 /* MaterialViewTests.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -989,6 +1005,7 @@ ...@@ -989,6 +1005,7 @@
963832501B88DFD80015F710 /* Debug */ = { 963832501B88DFD80015F710 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks", "$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)", "$(inherited)",
...@@ -1001,12 +1018,14 @@ ...@@ -1001,12 +1018,14 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.cosmicmind.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "io.cosmicmind.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Material; PRODUCT_NAME = Material;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
}; };
name = Debug; name = Debug;
}; };
963832511B88DFD80015F710 /* Release */ = { 963832511B88DFD80015F710 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks", "$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)", "$(inherited)",
......
...@@ -228,7 +228,7 @@ private var GridKey: UInt8 = 0 ...@@ -228,7 +228,7 @@ private var GridKey: UInt8 = 0
/// Grid extension for UIView. /// Grid extension for UIView.
public extension UIView { public extension UIView {
/// Grid reference. /// Grid reference.
public internal(set) var grid: Grid { public private(set) var grid: Grid {
get { get {
return MaterialAssociatedObject(self, key: &GridKey) { return MaterialAssociatedObject(self, key: &GridKey) {
return Grid() return Grid()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.36.1</string> <string>1.37.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -38,45 +38,6 @@ public enum MaterialDeviceType { ...@@ -38,45 +38,6 @@ public enum MaterialDeviceType {
} }
public struct MaterialDevice { public struct MaterialDevice {
/// Gets the model name for the device.
public static var model: String {
var systemInfo: utsname = utsname()
uname(&systemInfo)
let machineMirror: Mirror = Mirror(reflecting: systemInfo.machine)
let identifier: String = machineMirror.children.reduce("") { (identifier, element) in
guard let value = element.value as? Int8 where value != 0 else { return identifier }
return identifier + String(UnicodeScalar(UInt8(value)))
}
switch identifier {
case "iPod5,1": return "iPod Touch 5"
case "iPod7,1": return "iPod Touch 6"
case "iPhone3,1", "iPhone3,2", "iPhone3,3": return "iPhone 4"
case "iPhone4,1": return "iPhone 4s"
case "iPhone5,1", "iPhone5,2": return "iPhone 5"
case "iPhone5,3", "iPhone5,4": return "iPhone 5c"
case "iPhone6,1", "iPhone6,2": return "iPhone 5s"
case "iPhone7,2": return "iPhone 6"
case "iPhone7,1": return "iPhone 6 Plus"
case "iPhone8,1": return "iPhone 6s"
case "iPhone8,2": return "iPhone 6s Plus"
case "iPad2,1", "iPad2,2", "iPad2,3", "iPad2,4": return "iPad 2"
case "iPad3,1", "iPad3,2", "iPad3,3": return "iPad 3"
case "iPad3,4", "iPad3,5", "iPad3,6": return "iPad 4"
case "iPad4,1", "iPad4,2", "iPad4,3": return "iPad Air"
case "iPad5,3", "iPad5,4": return "iPad Air 2"
case "iPad2,5", "iPad2,6", "iPad2,7": return "iPad Mini"
case "iPad4,4", "iPad4,5", "iPad4,6": return "iPad Mini 2"
case "iPad4,7", "iPad4,8", "iPad4,9": return "iPad Mini 3"
case "iPad5,1", "iPad5,2": return "iPad Mini 4"
case "iPad6,7", "iPad6,8": return "iPad Pro"
case "AppleTV5,3": return "Apple TV"
case "i386", "x86_64": return "Simulator"
default: return identifier
}
}
/// Retrieves the current device type. /// Retrieves the current device type.
public static var type: MaterialDeviceType { public static var type: MaterialDeviceType {
switch UIDevice.currentDevice().userInterfaceIdiom { switch UIDevice.currentDevice().userInterfaceIdiom {
......
...@@ -52,14 +52,15 @@ public class NavigationBar : UINavigationBar { ...@@ -52,14 +52,15 @@ public class NavigationBar : UINavigationBar {
backIndicatorTransitionMaskImage property. backIndicatorTransitionMaskImage property.
*/ */
@IBInspectable public var backButtonImage: UIImage? { @IBInspectable public var backButtonImage: UIImage? {
didSet { get {
if nil == backButtonImage { return backIndicatorImage
backButtonImage = MaterialIcon.arrowBack
} }
backIndicatorImage = backButtonImage set(value) {
backIndicatorTransitionMaskImage = backButtonImage let image: UIImage? = nil == value ? MaterialIcon.arrowBack : value
backButton.setImage(backButtonImage, forState: .Normal) backIndicatorImage = image
backButton.setImage(backButtonImage, forState: .Highlighted) backIndicatorTransitionMaskImage = image
backButton.setImage(image, forState: .Normal)
backButton.setImage(image, forState: .Highlighted)
} }
} }
...@@ -255,15 +256,6 @@ public class NavigationBar : UINavigationBar { ...@@ -255,15 +256,6 @@ public class NavigationBar : UINavigationBar {
public override func layoutSubviews() { public override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
let h: CGFloat = intrinsicContentSize().height
let w: CGFloat = backButton.intrinsicContentSize().width
if let v: Array<UIControl> = topItem?.leftControls {
for c in v {
c.bounds.size = c is MaterialSwitch ? CGSizeMake(w, h - contentInset.top - contentInset.bottom) : CGSizeMake(c.intrinsicContentSize().width, h - contentInset.top - contentInset.bottom)
}
}
if let t: UILabel = topItem?.titleLabel { if let t: UILabel = topItem?.titleLabel {
t.grid.rows = 1 t.grid.rows = 1
topItem?.titleView?.grid.views = [t] topItem?.titleView?.grid.views = [t]
...@@ -285,12 +277,6 @@ public class NavigationBar : UINavigationBar { ...@@ -285,12 +277,6 @@ public class NavigationBar : UINavigationBar {
} }
} }
if let v: Array<UIControl> = topItem?.rightControls {
for c in v {
c.bounds.size = c is MaterialSwitch ? CGSizeMake(w, h - contentInset.top - contentInset.bottom) : CGSizeMake(c.intrinsicContentSize().width, h - contentInset.top - contentInset.bottom)
}
}
topItem?.titleView?.grid.reloadLayout() topItem?.titleView?.grid.reloadLayout()
} }
...@@ -308,7 +294,7 @@ public class NavigationBar : UINavigationBar { ...@@ -308,7 +294,7 @@ public class NavigationBar : UINavigationBar {
let h: CGFloat = intrinsicContentSize().height let h: CGFloat = intrinsicContentSize().height
let w: CGFloat = backButton.intrinsicContentSize().width let w: CGFloat = backButton.intrinsicContentSize().width
let inset: CGFloat = MaterialDevice.landscape ? item.landscapeInset : item.portraitInset let inset: CGFloat = item.inset
// leftControls // leftControls
if let v: Array<UIControl> = item.leftControls { if let v: Array<UIControl> = item.leftControls {
...@@ -331,44 +317,25 @@ public class NavigationBar : UINavigationBar { ...@@ -331,44 +317,25 @@ public class NavigationBar : UINavigationBar {
} }
// Set the titleView if title is empty. // Set the titleView if title is empty.
if nil == item.title { if "" == item.title {
if nil == item.titleView { if nil == item.titleView {
item.titleView = UIView(frame: CGRectMake(0, contentInset.top, MaterialDevice.width, h - contentInset.top - contentInset.bottom)) item.titleView = UIView(frame: CGRectMake(0, contentInset.top, MaterialDevice.width, h - contentInset.top - contentInset.bottom))
item.titleView!.autoresizingMask = .FlexibleWidth item.titleView!.autoresizingMask = .FlexibleWidth
item.titleView!.grid.axis.direction = .Vertical item.titleView!.grid.axis.direction = .Vertical
} }
item.titleView!.grid.views = []
// TitleView alignment. // TitleView alignment.
if let t: UILabel = item.titleLabel { if let t: UILabel = item.titleLabel {
t.grid.rows = 1
item.titleView!.addSubview(t) item.titleView!.addSubview(t)
item.titleView!.grid.views?.append(t)
if let d: UILabel = item.detailLabel { if let d: UILabel = item.detailLabel {
d.grid.rows = 1
d.hidden = false d.hidden = false
d.font = d.font.fontWithSize(12)
t.font = t.font.fontWithSize(17)
item.titleView!.addSubview(d) item.titleView!.addSubview(d)
item.titleView!.grid.axis.rows = 2
item.titleView!.grid.views?.append(d)
} else { } else {
t.font = t.font?.fontWithSize(20)
item.titleView!.grid.axis.rows = 1
item.detailLabel?.hidden = true item.detailLabel?.hidden = true
} }
} else if let d: UIView = item.detailView { } else if let d: UIView = item.detailView {
d.grid.rows = 1
item.titleView!.addSubview(d) item.titleView!.addSubview(d)
item.titleView!.grid.axis.rows = 1
item.titleView!.grid.views?.append(d)
} }
} }
...@@ -420,117 +387,8 @@ public class NavigationBar : UINavigationBar { ...@@ -420,117 +387,8 @@ public class NavigationBar : UINavigationBar {
/// Prepares the UINavigationItem for layout and sizing. /// Prepares the UINavigationItem for layout and sizing.
internal func prepareItem(item: UINavigationItem) { internal func prepareItem(item: UINavigationItem) {
if "" == item.title { if nil == item.title {
item.title = nil item.title = ""
}
}
}
/// A memory reference to the NavigationItem instance for UINavigationBar extensions.
private var NavigationItemKey: UInt8 = 0
public class NavigationItem {
/// Inset.
public var portraitInset: CGFloat = .iPad == MaterialDevice.type || "iPhone 6s Plus" == MaterialDevice.model || "iPhone 6 Plus" == MaterialDevice.model ? -20 : -16
public var landscapeInset: CGFloat = -20
/// Detail View.
public var detailView: UIView?
/// Title label.
public var titleLabel: UILabel?
/// Detail label.
public var detailLabel: UILabel?
/// Left controls.
public var leftControls: Array<UIControl>?
/// Right controls.
public var rightControls: Array<UIControl>?
}
public extension UINavigationItem {
/// NavigationBarControls reference.
public internal(set) var item: NavigationItem {
get {
return MaterialAssociatedObject(self, key: &NavigationItemKey) {
return NavigationItem()
}
}
set(value) {
MaterialAssociateObject(self, key: &NavigationItemKey, value: value)
}
}
/// Portrait inset.
public var portraitInset: CGFloat {
get {
return item.portraitInset
}
set(value) {
item.portraitInset = value
}
}
/// Landscape inset.
public var landscapeInset: CGFloat {
get {
return item.landscapeInset
}
set(value) {
item.landscapeInset = value
}
}
/// Detail View.
public var detailView: UIView? {
get {
return item.detailView
}
set(value) {
item.detailView = value
}
}
/// Title Label.
public var titleLabel: UILabel? {
get {
return item.titleLabel
}
set(value) {
item.titleLabel = value
}
}
/// Detail Label.
public var detailLabel: UILabel? {
get {
return item.detailLabel
}
set(value) {
item.detailLabel = value
}
}
/// Left side UIControls.
public var leftControls: Array<UIControl>? {
get {
return item.leftControls
}
set(value) {
item.leftControls = value
}
}
/// Right side UIControls.
public var rightControls: Array<UIControl>? {
get {
return item.rightControls
}
set(value) {
item.rightControls = value
} }
} }
} }
...@@ -71,7 +71,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -71,7 +71,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
public override func viewWillAppear(animated: Bool) { public override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
if let v: UIGestureRecognizer = interactivePopGestureRecognizer { if let v: UIGestureRecognizer = interactivePopGestureRecognizer {
if let x: SideNavigationViewController = sideNavigationViewController { if let x: SideNavigationController = sideNavigationController {
if let p: UIPanGestureRecognizer = x.panGesture { if let p: UIPanGestureRecognizer = x.panGesture {
p.requireGestureRecognizerToFail(v) p.requireGestureRecognizerToFail(v)
} }
...@@ -89,7 +89,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -89,7 +89,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
/** /**
Detects the gesture recognizer being used. This is necessary when using Detects the gesture recognizer being used. This is necessary when using
SideNavigationViewController. It eliminates the conflict in panning. SideNavigationController. It eliminates the conflict in panning.
- Parameter gestureRecognizer: A UIGestureRecognizer to detect. - Parameter gestureRecognizer: A UIGestureRecognizer to detect.
- Parameter touch: The UITouch event. - Parameter touch: The UITouch event.
- Returns: A Boolean of whether to continue the gesture or not, true yes, false no. - Returns: A Boolean of whether to continue the gesture or not, true yes, false no.
...@@ -122,7 +122,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -122,7 +122,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
return true return true
} }
public func sideNavigationStatusBarHiddenState(sideNavigationViewController: SideNavigationViewController, hidden: Bool) { public func sideNavigationStatusBarHiddenState(sideNavigationController: SideNavigationController, hidden: Bool) {
print(hidden) print(hidden)
} }
......
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
/// A memory reference to the NavigationItem instance.
private var NavigationItemKey: UInt8 = 0
public class NavigationItem {
/// Inset.
public var inset: CGFloat = -20
/// Detail View.
public var detailView: UIView?
/// Title label.
public var titleLabel: UILabel?
/// Detail label.
public var detailLabel: UILabel?
/// Left controls.
public var leftControls: Array<UIControl>?
/// Right controls.
public var rightControls: Array<UIControl>?
}
public extension UINavigationItem {
/// NavigationBarControls reference.
public internal(set) var item: NavigationItem {
get {
return MaterialAssociatedObject(self, key: &NavigationItemKey) {
return NavigationItem()
}
}
set(value) {
MaterialAssociateObject(self, key: &NavigationItemKey, value: value)
}
}
/// Inset.
public var inset: CGFloat {
get {
return item.inset
}
set(value) {
item.inset = value
}
}
/// Detail View.
public var detailView: UIView? {
get {
return item.detailView
}
set(value) {
item.detailView = value
}
}
/// Title Label.
public var titleLabel: UILabel? {
get {
return item.titleLabel
}
set(value) {
item.titleLabel = value
}
}
/// Detail Label.
public var detailLabel: UILabel? {
get {
return item.detailLabel
}
set(value) {
item.detailLabel = value
}
}
/// Left side UIControls.
public var leftControls: Array<UIControl>? {
get {
return item.leftControls
}
set(value) {
item.leftControls = value
}
}
/// Right side UIControls.
public var rightControls: Array<UIControl>? {
get {
return item.rightControls
}
set(value) {
item.rightControls = value
}
}
}
\ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public class SearchBarView : StatusBarView { public class SearchBar : StatusBarView {
/// The UITextField for the searchBar. /// The UITextField for the searchBar.
public private(set) lazy var textField: TextField = TextField() public private(set) lazy var textField: TextField = TextField()
......
...@@ -32,15 +32,15 @@ import UIKit ...@@ -32,15 +32,15 @@ import UIKit
public extension UIViewController { public extension UIViewController {
/** /**
A convenience property that provides access to the SearchBarViewController. A convenience property that provides access to the SearchBarController.
This is the recommended method of accessing the SearchBarViewController This is the recommended method of accessing the SearchBarController
through child UIViewControllers. through child UIViewControllers.
*/ */
public var searchBarViewController: SearchBarViewController? { public var searchBarController: SearchBarController? {
var viewController: UIViewController? = self var viewController: UIViewController? = self
while nil != viewController { while nil != viewController {
if viewController is SearchBarViewController { if viewController is SearchBarController {
return viewController as? SearchBarViewController return viewController as? SearchBarController
} }
viewController = viewController?.parentViewController viewController = viewController?.parentViewController
} }
...@@ -48,39 +48,39 @@ public extension UIViewController { ...@@ -48,39 +48,39 @@ public extension UIViewController {
} }
} }
public class SearchBarViewController : StatusBarViewController { public class SearchBarController : StatusBarViewController {
/// The height of the StatusBar. /// The height of the StatusBar.
@IBInspectable public override var heightForStatusBar: CGFloat { @IBInspectable public override var heightForStatusBar: CGFloat {
get { get {
return searchBarView.heightForStatusBar return searchBar.heightForStatusBar
} }
set(value) { set(value) {
searchBarView.heightForStatusBar = value searchBar.heightForStatusBar = value
} }
} }
/// The height when in Portrait orientation mode. /// The height when in Portrait orientation mode.
@IBInspectable public override var heightForPortraitOrientation: CGFloat { @IBInspectable public override var heightForPortraitOrientation: CGFloat {
get { get {
return searchBarView.heightForPortraitOrientation return searchBar.heightForPortraitOrientation
} }
set(value) { set(value) {
searchBarView.heightForPortraitOrientation = value searchBar.heightForPortraitOrientation = value
} }
} }
/// The height when in Landscape orientation mode. /// The height when in Landscape orientation mode.
@IBInspectable public override var heightForLandscapeOrientation: CGFloat { @IBInspectable public override var heightForLandscapeOrientation: CGFloat {
get { get {
return searchBarView.heightForLandscapeOrientation return searchBar.heightForLandscapeOrientation
} }
set(value) { set(value) {
searchBarView.heightForLandscapeOrientation = value searchBar.heightForLandscapeOrientation = value
} }
} }
/// Reference to the SearchBarView. /// Reference to the SearchBar.
public private(set) lazy var searchBarView: SearchBarView = SearchBarView() public private(set) lazy var searchBar: SearchBar = SearchBar()
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
...@@ -91,12 +91,12 @@ public class SearchBarViewController : StatusBarViewController { ...@@ -91,12 +91,12 @@ public class SearchBarViewController : StatusBarViewController {
*/ */
public override func prepareView() { public override func prepareView() {
super.prepareView() super.prepareView()
prepareSearchBarView() prepareSearchBar()
} }
/// Prepares the SearchBarView. /// Prepares the SearchBar.
private func prepareSearchBarView() { private func prepareSearchBar() {
searchBarView.zPosition = 1000 searchBar.zPosition = 1000
view.addSubview(searchBarView) view.addSubview(searchBar)
} }
} }
...@@ -38,15 +38,15 @@ public enum SideNavigationPosition : NSInteger { ...@@ -38,15 +38,15 @@ public enum SideNavigationPosition : NSInteger {
public extension UIViewController { public extension UIViewController {
/** /**
A convenience property that provides access to the SideNavigationViewController. A convenience property that provides access to the SideNavigationController.
This is the recommended method of accessing the SideNavigationViewController This is the recommended method of accessing the SideNavigationController
through child UIViewControllers. through child UIViewControllers.
*/ */
public var sideNavigationViewController: SideNavigationViewController? { public var sideNavigationController: SideNavigationController? {
var viewController: UIViewController? = self var viewController: UIViewController? = self
while nil != viewController { while nil != viewController {
if viewController is SideNavigationViewController { if viewController is SideNavigationController {
return viewController as? SideNavigationViewController return viewController as? SideNavigationController
} }
viewController = viewController?.parentViewController viewController = viewController?.parentViewController
} }
...@@ -54,66 +54,66 @@ public extension UIViewController { ...@@ -54,66 +54,66 @@ public extension UIViewController {
} }
} }
@objc(SideNavigationViewControllerDelegate) @objc(SideNavigationControllerDelegate)
public protocol SideNavigationViewControllerDelegate { public protocol SideNavigationControllerDelegate {
/** /**
An optional delegation method that is fired before the An optional delegation method that is fired before the
SideNavigationViewController opens. SideNavigationController opens.
*/ */
optional func sideNavigationViewWillOpen(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) optional func sideNavigationWillOpen(sideNavigationController: SideNavigationController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired after the An optional delegation method that is fired after the
SideNavigationViewController opened. SideNavigationController opened.
*/ */
optional func sideNavigationViewDidOpen(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) optional func sideNavigationDidOpen(sideNavigationController: SideNavigationController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired before the An optional delegation method that is fired before the
SideNavigationViewController closes. SideNavigationController closes.
*/ */
optional func sideNavigationViewWillClose(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) optional func sideNavigationWillClose(sideNavigationController: SideNavigationController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired after the An optional delegation method that is fired after the
SideNavigationViewController closed. SideNavigationController closed.
*/ */
optional func sideNavigationViewDidClose(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) optional func sideNavigationDidClose(sideNavigationController: SideNavigationController, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationViewController pan gesture begins. SideNavigationController pan gesture begins.
*/ */
optional func sideNavigationViewPanDidBegin(sideNavigationViewController: SideNavigationViewController, point: CGPoint, position: SideNavigationPosition) optional func sideNavigationPanDidBegin(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationViewController pan gesture changes position. SideNavigationController pan gesture changes position.
*/ */
optional func sideNavigationViewPanDidChange(sideNavigationViewController: SideNavigationViewController, point: CGPoint, position: SideNavigationPosition) optional func sideNavigationPanDidChange(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationViewController pan gesture ends. SideNavigationController pan gesture ends.
*/ */
optional func sideNavigationViewPanDidEnd(sideNavigationViewController: SideNavigationViewController, point: CGPoint, position: SideNavigationPosition) optional func sideNavigationPanDidEnd(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
SideNavigationViewController tap gesture executes. SideNavigationController tap gesture executes.
*/ */
optional func sideNavigationViewDidTap(sideNavigationViewController: SideNavigationViewController, point: CGPoint, position: SideNavigationPosition) optional func sideNavigationDidTap(sideNavigationController: SideNavigationController, point: CGPoint, position: SideNavigationPosition)
/** /**
An optional delegation method that is fired when the An optional delegation method that is fired when the
status bar is about to change display, hidden or not. status bar is about to change display, hidden or not.
*/ */
optional func sideNavigationStatusBarHiddenState(sideNavigationViewController: SideNavigationViewController, hidden: Bool) optional func sideNavigationStatusBarHiddenState(sideNavigationController: SideNavigationController, hidden: Bool)
} }
@IBDesignable @IBDesignable
@objc(SideNavigationViewController) @objc(SideNavigationController)
public class SideNavigationViewController : UIViewController, UIGestureRecognizerDelegate { public class SideNavigationController : UIViewController, UIGestureRecognizerDelegate {
/** /**
A CGFloat property that is used internally to track A CGFloat property that is used internally to track
the original (x) position of the container view when panning. the original (x) position of the container view when panning.
...@@ -134,7 +134,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -134,7 +134,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A CGFloat property that accesses the leftView threshold of A CGFloat property that accesses the leftView threshold of
the SideNavigationViewController. When the panning gesture has the SideNavigationController. When the panning gesture has
ended, if the position is beyond the threshold, ended, if the position is beyond the threshold,
the leftView is opened, if it is below the threshold, the the leftView is opened, if it is below the threshold, the
leftView is closed. The leftViewThreshold is always at half leftView is closed. The leftViewThreshold is always at half
...@@ -144,7 +144,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -144,7 +144,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A CGFloat property that accesses the rightView threshold of A CGFloat property that accesses the rightView threshold of
the SideNavigationViewController. When the panning gesture has the SideNavigationController. When the panning gesture has
ended, if the position is beyond the threshold, ended, if the position is beyond the threshold,
the rightView is closed, if it is below the threshold, the the rightView is closed, if it is below the threshold, the
rightView is opened. The rightViewThreshold is always at half rightView is opened. The rightViewThreshold is always at half
...@@ -153,10 +153,10 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -153,10 +153,10 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
@IBInspectable public var rightViewThreshold: CGFloat = 0 @IBInspectable public var rightViewThreshold: CGFloat = 0
/** /**
A SideNavigationViewControllerDelegate property used to bind A SideNavigationControllerDelegate property used to bind
the delegation object. the delegation object.
*/ */
public weak var delegate: SideNavigationViewControllerDelegate? public weak var delegate: SideNavigationControllerDelegate?
/** /**
A Boolean property used to enable and disable interactivity A Boolean property used to enable and disable interactivity
...@@ -287,7 +287,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -287,7 +287,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
@IBInspectable public private(set) var rightViewWidth: CGFloat = 240 @IBInspectable public private(set) var rightViewWidth: CGFloat = 240
/** /**
An initializer for the SideNavigationViewController. An initializer for the SideNavigationController.
- Parameter mainViewController: The main UIViewController. - Parameter mainViewController: The main UIViewController.
- Parameter leftViewController: An Optional left UIViewController. - Parameter leftViewController: An Optional left UIViewController.
- Parameter rightViewController: An Optional right UIViewController. - Parameter rightViewController: An Optional right UIViewController.
...@@ -506,13 +506,13 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -506,13 +506,13 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
toggleStatusBar(true) toggleStatusBar(true)
showView(v) showView(v)
delegate?.sideNavigationViewWillOpen?(self, position: .Left) delegate?.sideNavigationWillOpen?(self, position: .Left)
mainViewController.view.alpha = 0.5 mainViewController.view.alpha = 0.5
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { animations: {
v.position.x = v.width / 2 v.position.x = v.width / 2
}) { [unowned self] _ in }) { [unowned self] _ in
self.delegate?.sideNavigationViewDidOpen?(self, position: .Left) self.delegate?.sideNavigationDidOpen?(self, position: .Left)
} }
} }
} }
...@@ -530,13 +530,13 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -530,13 +530,13 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
toggleStatusBar(true) toggleStatusBar(true)
showView(v) showView(v)
delegate?.sideNavigationViewWillOpen?(self, position: .Right) delegate?.sideNavigationWillOpen?(self, position: .Right)
mainViewController.view.alpha = 0.5 mainViewController.view.alpha = 0.5
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [unowned self] in animations: { [unowned self] in
v.position.x = self.view.bounds.width - v.width / 2 v.position.x = self.view.bounds.width - v.width / 2
}) { [unowned self] _ in }) { [unowned self] _ in
self.delegate?.sideNavigationViewDidOpen?(self, position: .Right) self.delegate?.sideNavigationDidOpen?(self, position: .Right)
} }
} }
} }
...@@ -551,7 +551,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -551,7 +551,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
public func closeLeftView(velocity: CGFloat = 0) { public func closeLeftView(velocity: CGFloat = 0) {
if enabledLeftView { if enabledLeftView {
if let v: MaterialView = leftView { if let v: MaterialView = leftView {
delegate?.sideNavigationViewWillClose?(self, position: .Left) delegate?.sideNavigationWillClose?(self, position: .Left)
mainViewController.view.alpha = 1 mainViewController.view.alpha = 1
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { animations: {
...@@ -559,7 +559,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -559,7 +559,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
}) { [unowned self] _ in }) { [unowned self] _ in
self.toggleStatusBar() self.toggleStatusBar()
self.hideView(v) self.hideView(v)
self.delegate?.sideNavigationViewDidClose?(self, position: .Left) self.delegate?.sideNavigationDidClose?(self, position: .Left)
} }
} }
} }
...@@ -574,7 +574,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -574,7 +574,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
public func closeRightView(velocity: CGFloat = 0) { public func closeRightView(velocity: CGFloat = 0) {
if enabledRightView { if enabledRightView {
if let v: MaterialView = rightView { if let v: MaterialView = rightView {
delegate?.sideNavigationViewWillClose?(self, position: .Right) delegate?.sideNavigationWillClose?(self, position: .Right)
mainViewController.view.alpha = 1 mainViewController.view.alpha = 1
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [unowned self] in animations: { [unowned self] in
...@@ -582,7 +582,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -582,7 +582,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
}) { [unowned self] _ in }) { [unowned self] _ in
self.toggleStatusBar() self.toggleStatusBar()
self.hideView(v) self.hideView(v)
self.delegate?.sideNavigationViewDidClose?(self, position: .Right) self.delegate?.sideNavigationDidClose?(self, position: .Right)
} }
} }
} }
...@@ -603,7 +603,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -603,7 +603,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A method that is fired when the pan gesture is recognized A method that is fired when the pan gesture is recognized
for the SideNavigationViewController. for the SideNavigationController.
- Parameter recognizer: A UIPanGestureRecognizer that is - Parameter recognizer: A UIPanGestureRecognizer that is
passed to the handler when recognized. passed to the handler when recognized.
*/ */
...@@ -621,7 +621,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -621,7 +621,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
toggleStatusBar(true) toggleStatusBar(true)
showView(v) showView(v)
delegate?.sideNavigationViewPanDidBegin?(self, point: point, position: .Right) delegate?.sideNavigationPanDidBegin?(self, point: point, position: .Right)
case .Changed: case .Changed:
let w: CGFloat = v.width let w: CGFloat = v.width
let translationX: CGFloat = recognizer.translationInView(v).x let translationX: CGFloat = recognizer.translationInView(v).x
...@@ -631,12 +631,12 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -631,12 +631,12 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
let a: CGFloat = 1 - (view.bounds.width - v.position.x) / v.width let a: CGFloat = 1 - (view.bounds.width - v.position.x) / v.width
mainViewController.view.alpha = 0.5 < a ? a : 0.5 mainViewController.view.alpha = 0.5 < a ? a : 0.5
delegate?.sideNavigationViewPanDidChange?(self, point: point, position: .Right) delegate?.sideNavigationPanDidChange?(self, point: point, position: .Right)
case .Ended, .Cancelled, .Failed: case .Ended, .Cancelled, .Failed:
let p: CGPoint = recognizer.velocityInView(recognizer.view) let p: CGPoint = recognizer.velocityInView(recognizer.view)
let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0 let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0
delegate?.sideNavigationViewPanDidEnd?(self, point: point, position: .Right) delegate?.sideNavigationPanDidEnd?(self, point: point, position: .Right)
if v.x >= rightViewThreshold || x > 1000 { if v.x >= rightViewThreshold || x > 1000 {
closeRightView(x) closeRightView(x)
...@@ -658,7 +658,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -658,7 +658,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
toggleStatusBar(true) toggleStatusBar(true)
showView(v) showView(v)
delegate?.sideNavigationViewPanDidBegin?(self, point: point, position: .Left) delegate?.sideNavigationPanDidBegin?(self, point: point, position: .Left)
case .Changed: case .Changed:
let w: CGFloat = v.width let w: CGFloat = v.width
let translationX: CGFloat = recognizer.translationInView(v).x let translationX: CGFloat = recognizer.translationInView(v).x
...@@ -668,12 +668,12 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -668,12 +668,12 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
let a: CGFloat = 1 - v.position.x / v.width let a: CGFloat = 1 - v.position.x / v.width
mainViewController.view.alpha = 0.5 < a ? a : 0.5 mainViewController.view.alpha = 0.5 < a ? a : 0.5
delegate?.sideNavigationViewPanDidChange?(self, point: point, position: .Left) delegate?.sideNavigationPanDidChange?(self, point: point, position: .Left)
case .Ended, .Cancelled, .Failed: case .Ended, .Cancelled, .Failed:
let p: CGPoint = recognizer.velocityInView(recognizer.view) let p: CGPoint = recognizer.velocityInView(recognizer.view)
let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0 let x: CGFloat = p.x >= 1000 || p.x <= -1000 ? p.x : 0
delegate?.sideNavigationViewPanDidEnd?(self, point: point, position: .Left) delegate?.sideNavigationPanDidEnd?(self, point: point, position: .Left)
if v.x <= -leftViewWidth + leftViewThreshold || x < -1000 { if v.x <= -leftViewWidth + leftViewThreshold || x < -1000 {
closeLeftView(x) closeLeftView(x)
...@@ -688,14 +688,14 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -688,14 +688,14 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A method that is fired when the tap gesture is recognized A method that is fired when the tap gesture is recognized
for the SideNavigationViewController. for the SideNavigationController.
- Parameter recognizer: A UITapGestureRecognizer that is - Parameter recognizer: A UITapGestureRecognizer that is
passed to the handler when recognized. passed to the handler when recognized.
*/ */
internal func handleTapGesture(recognizer: UITapGestureRecognizer) { internal func handleTapGesture(recognizer: UITapGestureRecognizer) {
if openedLeftView { if openedLeftView {
if let v: MaterialView = leftView { if let v: MaterialView = leftView {
delegate?.sideNavigationViewDidTap?(self, point: recognizer.locationInView(view), position: .Left) delegate?.sideNavigationDidTap?(self, point: recognizer.locationInView(view), position: .Left)
if enabledLeftView && openedLeftView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) { if enabledLeftView && openedLeftView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) {
closeLeftView() closeLeftView()
} }
...@@ -703,7 +703,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -703,7 +703,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
} }
if openedRightView { if openedRightView {
if let v: MaterialView = rightView { if let v: MaterialView = rightView {
delegate?.sideNavigationViewDidTap?(self, point: recognizer.locationInView(view), position: .Right) delegate?.sideNavigationDidTap?(self, point: recognizer.locationInView(view), position: .Right)
if enabledRightView && openedRightView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) { if enabledRightView && openedRightView && !isPointContainedWithinView(v, point: recognizer.locationInView(v)) {
closeRightView() closeRightView()
} }
...@@ -711,7 +711,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -711,7 +711,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
} }
} }
/// A method that generally prepares the SideNavigationViewController. /// A method that generally prepares the SideNavigationController.
private func prepareView() { private func prepareView() {
prepareMainViewController() prepareMainViewController()
prepareLeftView() prepareLeftView()
...@@ -777,7 +777,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -777,7 +777,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A method that adds the passed in controller as a child of A method that adds the passed in controller as a child of
the SideNavigationViewController within the passed in the SideNavigationController within the passed in
container view. container view.
- Parameter viewController: A UIViewController to add as a child. - Parameter viewController: A UIViewController to add as a child.
- Parameter container: A UIView that is the parent of the - Parameter container: A UIView that is the parent of the
...@@ -793,7 +793,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -793,7 +793,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A method that prepares the gestures used within the A method that prepares the gestures used within the
SideNavigationViewController. SideNavigationController.
*/ */
private func prepareGestures() { private func prepareGestures() {
if nil == panGesture { if nil == panGesture {
...@@ -856,7 +856,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -856,7 +856,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A method that determines whether the passed point is A method that determines whether the passed point is
contained within the bounds of the leftViewThreshold contained within the bounds of the leftViewThreshold
and height of the SideNavigationViewController view frame and height of the SideNavigationController view frame
property. property.
- Parameter point: A CGPoint to test against. - Parameter point: A CGPoint to test against.
- Returns: A Boolean of the result, true if yes, false - Returns: A Boolean of the result, true if yes, false
...@@ -869,7 +869,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize ...@@ -869,7 +869,7 @@ public class SideNavigationViewController : UIViewController, UIGestureRecognize
/** /**
A method that determines whether the passed point is A method that determines whether the passed point is
contained within the bounds of the rightViewThreshold contained within the bounds of the rightViewThreshold
and height of the SideNavigationViewController view frame and height of the SideNavigationController view frame
property. property.
- Parameter point: A CGPoint to test against. - Parameter point: A CGPoint to test against.
- Returns: A Boolean of the result, true if yes, false - Returns: A Boolean of the result, true if yes, false
......
...@@ -101,7 +101,7 @@ public class StatusBarView : ControlView { ...@@ -101,7 +101,7 @@ public class StatusBarView : ControlView {
super.prepareView() super.prepareView()
depth = .Depth1 depth = .Depth1
spacingPreset = .Spacing2 spacingPreset = .Spacing2
contentInsetPreset = .Square2 contentInset = UIEdgeInsetsMake(2, 2, 2, 2)
autoresizingMask = .FlexibleWidth autoresizingMask = .FlexibleWidth
shadowPathAutoSizeEnabled = false shadowPathAutoSizeEnabled = false
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public class NavigationBarView : StatusBarView { public class Toolbar : StatusBarView {
/// Title label. /// Title label.
public var titleLabel: UILabel? { public var titleLabel: UILabel? {
didSet { didSet {
......
...@@ -32,15 +32,15 @@ import UIKit ...@@ -32,15 +32,15 @@ import UIKit
public extension UIViewController { public extension UIViewController {
/** /**
A convenience property that provides access to the NavigationBarViewController. A convenience property that provides access to the ToolbarController.
This is the recommended method of accessing the NavigationBarViewController This is the recommended method of accessing the ToolbarController
through child UIViewControllers. through child UIViewControllers.
*/ */
public var navigationBarViewController: NavigationBarViewController? { public var toolbarController: ToolbarController? {
var viewController: UIViewController? = self var viewController: UIViewController? = self
while nil != viewController { while nil != viewController {
if viewController is NavigationBarViewController { if viewController is ToolbarController {
return viewController as? NavigationBarViewController return viewController as? ToolbarController
} }
viewController = viewController?.parentViewController viewController = viewController?.parentViewController
} }
...@@ -48,61 +48,61 @@ public extension UIViewController { ...@@ -48,61 +48,61 @@ public extension UIViewController {
} }
} }
@objc(NavigationBarViewControllerDelegate) @objc(ToolbarControllerDelegate)
public protocol NavigationBarViewControllerDelegate : MaterialDelegate { public protocol ToolbarControllerDelegate : MaterialDelegate {
/// Delegation method that executes when the floatingViewController will open. /// Delegation method that executes when the floatingViewController will open.
optional func navigationBarViewControllerWillOpenFloatingViewController(navigationBarViewController: NavigationBarViewController) optional func toolbarControllerWillOpenFloatingViewController(toolbarController: ToolbarController)
/// Delegation method that executes when the floatingViewController will close. /// Delegation method that executes when the floatingViewController will close.
optional func navigationBarViewControllerWillCloseFloatingViewController(navigationBarViewController: NavigationBarViewController) optional func toolbarControllerWillCloseFloatingViewController(toolbarController: ToolbarController)
/// Delegation method that executes when the floatingViewController did open. /// Delegation method that executes when the floatingViewController did open.
optional func navigationBarViewControllerDidOpenFloatingViewController(navigationBarViewController: NavigationBarViewController) optional func toolbarControllerDidOpenFloatingViewController(toolbarController: ToolbarController)
/// Delegation method that executes when the floatingViewController did close. /// Delegation method that executes when the floatingViewController did close.
optional func navigationBarViewControllerDidCloseFloatingViewController(navigationBarViewController: NavigationBarViewController) optional func toolbarControllerDidCloseFloatingViewController(toolbarController: ToolbarController)
} }
@objc(NavigationBarViewController) @objc(ToolbarController)
public class NavigationBarViewController : StatusBarViewController { public class ToolbarController : StatusBarViewController {
/// The height of the StatusBar. /// The height of the StatusBar.
@IBInspectable public override var heightForStatusBar: CGFloat { @IBInspectable public override var heightForStatusBar: CGFloat {
get { get {
return navigationBarView.heightForStatusBar return toolbar.heightForStatusBar
} }
set(value) { set(value) {
navigationBarView.heightForStatusBar = value toolbar.heightForStatusBar = value
} }
} }
/// The height when in Portrait orientation mode. /// The height when in Portrait orientation mode.
@IBInspectable public override var heightForPortraitOrientation: CGFloat { @IBInspectable public override var heightForPortraitOrientation: CGFloat {
get { get {
return navigationBarView.heightForPortraitOrientation return toolbar.heightForPortraitOrientation
} }
set(value) { set(value) {
navigationBarView.heightForPortraitOrientation = value toolbar.heightForPortraitOrientation = value
} }
} }
/// The height when in Landscape orientation mode. /// The height when in Landscape orientation mode.
@IBInspectable public override var heightForLandscapeOrientation: CGFloat { @IBInspectable public override var heightForLandscapeOrientation: CGFloat {
get { get {
return navigationBarView.heightForLandscapeOrientation return toolbar.heightForLandscapeOrientation
} }
set(value) { set(value) {
navigationBarView.heightForLandscapeOrientation = value toolbar.heightForLandscapeOrientation = value
} }
} }
/// Internal reference to the floatingViewController. /// Internal reference to the floatingViewController.
private var internalFloatingViewController: UIViewController? private var internalFloatingViewController: UIViewController?
/// Reference to the NavigationBarView. /// Reference to the Toolbar.
public private(set) lazy var navigationBarView: NavigationBarView = NavigationBarView() public private(set) lazy var toolbar: Toolbar = Toolbar()
/// Delegation handler. /// Delegation handler.
public weak var delegate: NavigationBarViewControllerDelegate? public weak var delegate: ToolbarControllerDelegate?
/// A floating UIViewController. /// A floating UIViewController.
public var floatingViewController: UIViewController? { public var floatingViewController: UIViewController? {
...@@ -113,12 +113,12 @@ public class NavigationBarViewController : StatusBarViewController { ...@@ -113,12 +113,12 @@ public class NavigationBarViewController : StatusBarViewController {
if let v: UIViewController = internalFloatingViewController { if let v: UIViewController = internalFloatingViewController {
v.view.layer.rasterizationScale = MaterialDevice.scale v.view.layer.rasterizationScale = MaterialDevice.scale
v.view.layer.shouldRasterize = true v.view.layer.shouldRasterize = true
delegate?.navigationBarViewControllerWillCloseFloatingViewController?(self) delegate?.toolbarControllerWillCloseFloatingViewController?(self)
internalFloatingViewController = nil internalFloatingViewController = nil
UIView.animateWithDuration(0.5, UIView.animateWithDuration(0.5,
animations: { [unowned self] in animations: { [unowned self] in
v.view.center.y = 2 * self.view.bounds.height v.view.center.y = 2 * self.view.bounds.height
self.navigationBarView.alpha = 1 self.toolbar.alpha = 1
self.mainViewController.view.alpha = 1 self.mainViewController.view.alpha = 1
}) { [unowned self] _ in }) { [unowned self] _ in
v.willMoveToParentViewController(nil) v.willMoveToParentViewController(nil)
...@@ -126,9 +126,9 @@ public class NavigationBarViewController : StatusBarViewController { ...@@ -126,9 +126,9 @@ public class NavigationBarViewController : StatusBarViewController {
v.removeFromParentViewController() v.removeFromParentViewController()
v.view.layer.shouldRasterize = false v.view.layer.shouldRasterize = false
self.userInteractionEnabled = true self.userInteractionEnabled = true
self.navigationBarView.userInteractionEnabled = true self.toolbar.userInteractionEnabled = true
dispatch_async(dispatch_get_main_queue()) { [unowned self] in dispatch_async(dispatch_get_main_queue()) { [unowned self] in
self.delegate?.navigationBarViewControllerDidCloseFloatingViewController?(self) self.delegate?.toolbarControllerDidCloseFloatingViewController?(self)
} }
} }
} }
...@@ -139,7 +139,7 @@ public class NavigationBarViewController : StatusBarViewController { ...@@ -139,7 +139,7 @@ public class NavigationBarViewController : StatusBarViewController {
v.view.frame = view.bounds v.view.frame = view.bounds
v.view.center.y = 2 * view.bounds.height v.view.center.y = 2 * view.bounds.height
v.view.hidden = true v.view.hidden = true
view.insertSubview(v.view, aboveSubview: navigationBarView) view.insertSubview(v.view, aboveSubview: toolbar)
v.view.layer.zPosition = 1500 v.view.layer.zPosition = 1500
v.didMoveToParentViewController(self) v.didMoveToParentViewController(self)
...@@ -151,18 +151,18 @@ public class NavigationBarViewController : StatusBarViewController { ...@@ -151,18 +151,18 @@ public class NavigationBarViewController : StatusBarViewController {
view.layer.shouldRasterize = true view.layer.shouldRasterize = true
internalFloatingViewController = v internalFloatingViewController = v
userInteractionEnabled = false userInteractionEnabled = false
navigationBarView.userInteractionEnabled = false toolbar.userInteractionEnabled = false
delegate?.navigationBarViewControllerWillOpenFloatingViewController?(self) delegate?.toolbarControllerWillOpenFloatingViewController?(self)
UIView.animateWithDuration(0.5, UIView.animateWithDuration(0.5,
animations: { [unowned self] in animations: { [unowned self] in
v.view.center.y = self.view.bounds.height / 2 v.view.center.y = self.view.bounds.height / 2
self.navigationBarView.alpha = 0.5 self.toolbar.alpha = 0.5
self.mainViewController.view.alpha = 0.5 self.mainViewController.view.alpha = 0.5
}) { [unowned self] _ in }) { [unowned self] _ in
v.view.layer.shouldRasterize = false v.view.layer.shouldRasterize = false
self.view.layer.shouldRasterize = false self.view.layer.shouldRasterize = false
dispatch_async(dispatch_get_main_queue()) { [unowned self] in dispatch_async(dispatch_get_main_queue()) { [unowned self] in
self.delegate?.navigationBarViewControllerDidOpenFloatingViewController?(self) self.delegate?.toolbarControllerDidOpenFloatingViewController?(self)
} }
} }
} }
...@@ -178,12 +178,12 @@ public class NavigationBarViewController : StatusBarViewController { ...@@ -178,12 +178,12 @@ public class NavigationBarViewController : StatusBarViewController {
*/ */
public override func prepareView() { public override func prepareView() {
super.prepareView() super.prepareView()
prepareNavigationBarView() prepareToolbar()
} }
/// Prepares the NavigationBarView. /// Prepares the Toolbar.
private func prepareNavigationBarView() { private func prepareToolbar() {
navigationBarView.zPosition = 1000 toolbar.zPosition = 1000
view.addSubview(navigationBarView) view.addSubview(toolbar)
} }
} }
\ No newline at end of file
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
import XCTest
import Material
class MaterialTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Algorithm nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import XCTest
@testable import Material
class MaterialViewTests: XCTestCase {
override func setUp() {
super.setUp()
}
override func tearDown() {
super.tearDown()
}
func testAll() {
XCTAssertTrue(true, "Pass")
}
func testPerformance() {
self.measureBlock() {}
}
}
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