Commit e097bb28 by Daniel Dahan

removed NavigationBarViewDelegate and SearchBarViewDelegate

parent bc09da94
......@@ -7,8 +7,6 @@
objects = {
/* 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 */; };
96D88C851C132C1800B91418 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C841C132C1800B91418 /* ViewController.swift */; };
96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C891C132C1800B91418 /* Assets.xcassets */; };
......@@ -22,7 +20,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
9656265C1C87F57C004ADEF7 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -30,7 +27,6 @@
/* End PBXCopyFilesBuildPhase 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; };
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>"; };
......@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9656265B1C87F57C004ADEF7 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -54,7 +49,6 @@
96D88C761C132C1800B91418 = {
isa = PBXGroup;
children = (
9656265A1C87F57C004ADEF7 /* Material.framework */,
96D88C811C132C1800B91418 /* NavigationBarView */,
96D88C801C132C1800B91418 /* Products */,
);
......
......@@ -72,8 +72,8 @@ class ViewController: UIViewController {
// Menu button.
let menuButton: FlatButton = FlatButton()
menuButton.pulseColor = MaterialColor.white
menuButton.pulseScale = false
menuButton.pulseColor = MaterialColor.white
menuButton.setImage(image, forState: .Normal)
menuButton.setImage(image, forState: .Highlighted)
......@@ -83,8 +83,8 @@ class ViewController: UIViewController {
// Search button.
image = UIImage(named: "ic_search_white")
let searchButton: FlatButton = FlatButton()
searchButton.pulseColor = MaterialColor.white
searchButton.pulseScale = false
searchButton.pulseColor = MaterialColor.white
searchButton.setImage(image, forState: .Normal)
searchButton.setImage(image, forState: .Highlighted)
......@@ -95,7 +95,6 @@ class ViewController: UIViewController {
*/
navigationBarView.statusBarStyle = .LightContent
navigationBarView.delegate = self
navigationBarView.backgroundColor = MaterialColor.blue.base
navigationBarView.titleLabel = titleLabel
navigationBarView.detailLabel = detailLabel
......@@ -105,11 +104,3 @@ class ViewController: UIViewController {
view.addSubview(navigationBarView)
}
}
/// NavigationBarViewDelegate methods.
extension ViewController: NavigationBarViewDelegate {
func navigationBarViewDidChangeLayout(navigationBarView: NavigationBarView) {
print("Updated Frame: \(navigationBarView.frame)")
}
}
......@@ -91,12 +91,11 @@ class ViewController: UIViewController {
*/
searchBarView.statusBarStyle = .Default
searchBarView.delegate = self
searchBarView.placeholder = "Search"
searchBarView.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regularWithSize(20)
searchBarView.textField.font = RobotoFont.regular
searchBarView.clearButton = clearButton
searchBarView.leftControls = [backButton]
......@@ -105,12 +104,3 @@ class ViewController: UIViewController {
view.addSubview(searchBarView)
}
}
/// SearchBarViewDelegate methods.
extension ViewController: SearchBarViewDelegate {
func searchBarViewDidChangeLayout(searchBarView: SearchBarView) {
print("Updated Frame: \(searchBarView.frame)")
}
}
......@@ -117,7 +117,7 @@ class AppSearchBarViewController: SearchBarViewController {
searchBarView.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regularWithSize(20)
searchBarView.textField.font = RobotoFont.regular
searchBarView.textField.delegate = self
searchBarView.clearButton = clearButton
......
......@@ -35,12 +35,16 @@ class ViewController: UIViewController {
@IBOutlet weak var navigationBarView: NavigationBarView!
/// ************* This needs to be attached to the Storyboard. *************
@IBOutlet weak var navigationBarViewHeightConstraint: NSLayoutConstraint?
override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
// if landscape
// If landscape.
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
} else {
navigationBarViewHeightConstraint?.constant = navigationBarView!.heightForPortraitOrientation
......
......@@ -30,11 +30,6 @@
import UIKit
@objc(NavigationBarView)
public protocol NavigationBarViewDelegate : MaterialDelegate {
optional func navigationBarViewDidChangeLayout(navigationBarView: NavigationBarView)
}
public class NavigationBarView : StatusBarView {
/// Title label.
public var titleLabel: UILabel? {
......@@ -88,7 +83,7 @@ public class NavigationBarView : StatusBarView {
contentView.grid.contentInset.top = -8
} else {
v.grid.rows = 1
v.font = v.font.fontWithSize(20)
v.font = v.font?.fontWithSize(20)
contentView.grid.axis.rows = 1
contentView.grid.spacing = 0
contentView.grid.contentInset.top = 0
......
......@@ -30,11 +30,6 @@
import UIKit
@objc(SearchBarViewDelegate)
public protocol SearchBarViewDelegate : MaterialDelegate {
optional func searchBarViewDidChangeLayout(searchBarView: SearchBarView)
}
public class SearchBarView : StatusBarView {
/// The UITextField for the searchBar.
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