Commit e097bb28 by Daniel Dahan

removed NavigationBarViewDelegate and SearchBarViewDelegate

parent bc09da94
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
9656265B1C87F57C004ADEF7 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9656265A1C87F57C004ADEF7 /* Material.framework */; };
9656265C1C87F57C004ADEF7 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9656265A1C87F57C004ADEF7 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96D88C831C132C1800B91418 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C821C132C1800B91418 /* AppDelegate.swift */; }; 96D88C831C132C1800B91418 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C821C132C1800B91418 /* AppDelegate.swift */; };
96D88C851C132C1800B91418 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C841C132C1800B91418 /* ViewController.swift */; }; 96D88C851C132C1800B91418 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C841C132C1800B91418 /* ViewController.swift */; };
96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C891C132C1800B91418 /* Assets.xcassets */; }; 96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C891C132C1800B91418 /* Assets.xcassets */; };
...@@ -22,7 +20,6 @@ ...@@ -22,7 +20,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
9656265C1C87F57C004ADEF7 /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -30,7 +27,6 @@ ...@@ -30,7 +27,6 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9656265A1C87F57C004ADEF7 /* 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>"; };
96D88C7F1C132C1800B91418 /* NavigationBarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 96D88C7F1C132C1800B91418 /* NavigationBarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarView.app; sourceTree = BUILT_PRODUCTS_DIR; };
96D88C821C132C1800B91418 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 96D88C821C132C1800B91418 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96D88C841C132C1800B91418 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 96D88C841C132C1800B91418 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
...@@ -44,7 +40,6 @@ ...@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9656265B1C87F57C004ADEF7 /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -54,7 +49,6 @@ ...@@ -54,7 +49,6 @@
96D88C761C132C1800B91418 = { 96D88C761C132C1800B91418 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9656265A1C87F57C004ADEF7 /* Material.framework */,
96D88C811C132C1800B91418 /* NavigationBarView */, 96D88C811C132C1800B91418 /* NavigationBarView */,
96D88C801C132C1800B91418 /* Products */, 96D88C801C132C1800B91418 /* Products */,
); );
......
...@@ -72,8 +72,8 @@ class ViewController: UIViewController { ...@@ -72,8 +72,8 @@ class ViewController: UIViewController {
// Menu button. // Menu button.
let menuButton: FlatButton = FlatButton() let menuButton: FlatButton = FlatButton()
menuButton.pulseColor = MaterialColor.white
menuButton.pulseScale = false menuButton.pulseScale = false
menuButton.pulseColor = MaterialColor.white
menuButton.setImage(image, forState: .Normal) menuButton.setImage(image, forState: .Normal)
menuButton.setImage(image, forState: .Highlighted) menuButton.setImage(image, forState: .Highlighted)
...@@ -83,8 +83,8 @@ class ViewController: UIViewController { ...@@ -83,8 +83,8 @@ class ViewController: UIViewController {
// Search button. // Search button.
image = UIImage(named: "ic_search_white") image = UIImage(named: "ic_search_white")
let searchButton: FlatButton = FlatButton() let searchButton: FlatButton = FlatButton()
searchButton.pulseColor = MaterialColor.white
searchButton.pulseScale = false searchButton.pulseScale = false
searchButton.pulseColor = MaterialColor.white
searchButton.setImage(image, forState: .Normal) searchButton.setImage(image, forState: .Normal)
searchButton.setImage(image, forState: .Highlighted) searchButton.setImage(image, forState: .Highlighted)
...@@ -94,8 +94,7 @@ class ViewController: UIViewController { ...@@ -94,8 +94,7 @@ class ViewController: UIViewController {
to your info.plist file and set the following property. to your info.plist file and set the following property.
*/ */
navigationBarView.statusBarStyle = .LightContent navigationBarView.statusBarStyle = .LightContent
navigationBarView.delegate = self
navigationBarView.backgroundColor = MaterialColor.blue.base navigationBarView.backgroundColor = MaterialColor.blue.base
navigationBarView.titleLabel = titleLabel navigationBarView.titleLabel = titleLabel
navigationBarView.detailLabel = detailLabel navigationBarView.detailLabel = detailLabel
...@@ -105,11 +104,3 @@ class ViewController: UIViewController { ...@@ -105,11 +104,3 @@ class ViewController: UIViewController {
view.addSubview(navigationBarView) view.addSubview(navigationBarView)
} }
} }
/// NavigationBarViewDelegate methods.
extension ViewController: NavigationBarViewDelegate {
func navigationBarViewDidChangeLayout(navigationBarView: NavigationBarView) {
print("Updated Frame: \(navigationBarView.frame)")
}
}
...@@ -91,12 +91,11 @@ class ViewController: UIViewController { ...@@ -91,12 +91,11 @@ class ViewController: UIViewController {
*/ */
searchBarView.statusBarStyle = .Default searchBarView.statusBarStyle = .Default
searchBarView.delegate = self
searchBarView.placeholder = "Search" searchBarView.placeholder = "Search"
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBarView.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4 searchBarView.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4 searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regularWithSize(20) searchBarView.textField.font = RobotoFont.regular
searchBarView.clearButton = clearButton searchBarView.clearButton = clearButton
searchBarView.leftControls = [backButton] searchBarView.leftControls = [backButton]
...@@ -105,12 +104,3 @@ class ViewController: UIViewController { ...@@ -105,12 +104,3 @@ class ViewController: UIViewController {
view.addSubview(searchBarView) view.addSubview(searchBarView)
} }
} }
/// SearchBarViewDelegate methods.
extension ViewController: SearchBarViewDelegate {
func searchBarViewDidChangeLayout(searchBarView: SearchBarView) {
print("Updated Frame: \(searchBarView.frame)")
}
}
...@@ -117,7 +117,7 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -117,7 +117,7 @@ class AppSearchBarViewController: SearchBarViewController {
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBarView.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4 searchBarView.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4 searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regularWithSize(20) searchBarView.textField.font = RobotoFont.regular
searchBarView.textField.delegate = self searchBarView.textField.delegate = self
searchBarView.clearButton = clearButton searchBarView.clearButton = clearButton
......
...@@ -35,12 +35,16 @@ class ViewController: UIViewController { ...@@ -35,12 +35,16 @@ class ViewController: UIViewController {
@IBOutlet weak var navigationBarView: NavigationBarView! @IBOutlet weak var navigationBarView: NavigationBarView!
/// ************* This needs to be attached to the Storyboard. *************
@IBOutlet weak var navigationBarViewHeightConstraint: NSLayoutConstraint? @IBOutlet weak var navigationBarViewHeightConstraint: 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.
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.
*/
navigationBarViewHeightConstraint?.constant = .iPad == MaterialDevice.type ? navigationBarView!.heightForPortraitOrientation : navigationBarView!.heightForLandscapeOrientation navigationBarViewHeightConstraint?.constant = .iPad == MaterialDevice.type ? navigationBarView!.heightForPortraitOrientation : navigationBarView!.heightForLandscapeOrientation
} else { } else {
navigationBarViewHeightConstraint?.constant = navigationBarView!.heightForPortraitOrientation navigationBarViewHeightConstraint?.constant = navigationBarView!.heightForPortraitOrientation
......
...@@ -30,11 +30,6 @@ ...@@ -30,11 +30,6 @@
import UIKit import UIKit
@objc(NavigationBarView)
public protocol NavigationBarViewDelegate : MaterialDelegate {
optional func navigationBarViewDidChangeLayout(navigationBarView: NavigationBarView)
}
public class NavigationBarView : StatusBarView { public class NavigationBarView : StatusBarView {
/// Title label. /// Title label.
public var titleLabel: UILabel? { public var titleLabel: UILabel? {
...@@ -88,7 +83,7 @@ public class NavigationBarView : StatusBarView { ...@@ -88,7 +83,7 @@ public class NavigationBarView : StatusBarView {
contentView.grid.contentInset.top = -8 contentView.grid.contentInset.top = -8
} else { } else {
v.grid.rows = 1 v.grid.rows = 1
v.font = v.font.fontWithSize(20) v.font = v.font?.fontWithSize(20)
contentView.grid.axis.rows = 1 contentView.grid.axis.rows = 1
contentView.grid.spacing = 0 contentView.grid.spacing = 0
contentView.grid.contentInset.top = 0 contentView.grid.contentInset.top = 0
......
...@@ -30,11 +30,6 @@ ...@@ -30,11 +30,6 @@
import UIKit import UIKit
@objc(SearchBarViewDelegate)
public protocol SearchBarViewDelegate : MaterialDelegate {
optional func searchBarViewDidChangeLayout(searchBarView: SearchBarView)
}
public class SearchBarView : StatusBarView { public class SearchBarView : 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()
......
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