Commit 896b88da by Daniel Dahan

prepare for release

parent c1362e9a
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
96162C6C1CA71C8700E3A235 /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C6B1CA71C8700E3A235 /* VideoViewController.swift */; }; 96162C6C1CA71C8700E3A235 /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C6B1CA71C8700E3A235 /* VideoViewController.swift */; };
96162C6E1CA7274E00E3A235 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C6D1CA7274E00E3A235 /* PhotoViewController.swift */; }; 96162C6E1CA7274E00E3A235 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C6D1CA7274E00E3A235 /* PhotoViewController.swift */; };
9658F2221CD7B30700B902C1 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9658F2211CD7B30700B902C1 /* Material.framework */; };
9658F2231CD7B30700B902C1 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9658F2211CD7B30700B902C1 /* 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 */; };
...@@ -30,7 +28,6 @@ ...@@ -30,7 +28,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
9658F2231CD7B30700B902C1 /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -40,7 +37,6 @@ ...@@ -40,7 +37,6 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
96162C6B1CA71C8700E3A235 /* VideoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoViewController.swift; sourceTree = "<group>"; }; 96162C6B1CA71C8700E3A235 /* VideoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoViewController.swift; sourceTree = "<group>"; };
96162C6D1CA7274E00E3A235 /* PhotoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoViewController.swift; sourceTree = "<group>"; }; 96162C6D1CA7274E00E3A235 /* PhotoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoViewController.swift; sourceTree = "<group>"; };
9658F2211CD7B30700B902C1 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/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>"; };
...@@ -60,7 +56,6 @@ ...@@ -60,7 +56,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9658F2221CD7B30700B902C1 /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -70,7 +65,6 @@ ...@@ -70,7 +65,6 @@
9663F9251C7A744500AF0965 = { 9663F9251C7A744500AF0965 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9658F2211CD7B30700B902C1 /* Material.framework */,
9663F9301C7A744600AF0965 /* App */, 9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */, 9663F92F1C7A744600AF0965 /* Products */,
); );
......
...@@ -63,7 +63,7 @@ class ViewController: UIViewController { ...@@ -63,7 +63,7 @@ class ViewController: UIViewController {
override func viewWillLayoutSubviews() { override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews() super.viewWillLayoutSubviews()
navigationBar.frame = CGRectMake(0, 0, view.bounds.width, MaterialDevice.landscape ? .iPad == MaterialDevice.type ? 64 : navigationBar.intrinsicContentSize().height : 64) navigationBar.frame = CGRectMake(0, 0, view.bounds.width, MaterialDevice.isLandscape ? .iPad == MaterialDevice.type ? 64 : navigationBar.intrinsicContentSize().height : 64)
} }
/// General preparation statements. /// General preparation statements.
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
9658F21F1CD7ACD600B902C1 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9658F21E1CD7ACD600B902C1 /* Material.framework */; };
9658F2201CD7ACD600B902C1 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9658F21E1CD7ACD600B902C1 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96E5E4671CC1E5EC0054837B /* PurpleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */; }; 96E5E4671CC1E5EC0054837B /* PurpleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */; };
96E5E4691CC1E6130054837B /* OrangeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E4681CC1E6130054837B /* OrangeViewController.swift */; }; 96E5E4691CC1E6130054837B /* OrangeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E4681CC1E6130054837B /* OrangeViewController.swift */; };
96E5E46B1CC1E8FB0054837B /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E46A1CC1E8FB0054837B /* AppLeftViewController.swift */; }; 96E5E46B1CC1E8FB0054837B /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E46A1CC1E8FB0054837B /* AppLeftViewController.swift */; };
...@@ -27,7 +25,6 @@ ...@@ -27,7 +25,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
9658F2201CD7ACD600B902C1 /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -35,7 +32,6 @@ ...@@ -35,7 +32,6 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9658F21E1CD7ACD600B902C1 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
9663F9651C7ADCB600AF0965 /* SideNavigationController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigationController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9663F9651C7ADCB600AF0965 /* SideNavigationController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigationController.app; sourceTree = BUILT_PRODUCTS_DIR; };
96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PurpleViewController.swift; sourceTree = "<group>"; }; 96E5E4661CC1E5EC0054837B /* PurpleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PurpleViewController.swift; sourceTree = "<group>"; };
96E5E4681CC1E6130054837B /* OrangeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrangeViewController.swift; sourceTree = "<group>"; }; 96E5E4681CC1E6130054837B /* OrangeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrangeViewController.swift; sourceTree = "<group>"; };
...@@ -54,7 +50,6 @@ ...@@ -54,7 +50,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9658F21F1CD7ACD600B902C1 /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -64,7 +59,6 @@ ...@@ -64,7 +59,6 @@
9663F95C1C7ADCB600AF0965 = { 9663F95C1C7ADCB600AF0965 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9658F21E1CD7ACD600B902C1 /* Material.framework */,
96F2F1FC1C97A68800A5FE27 /* SideNavigationController */, 96F2F1FC1C97A68800A5FE27 /* SideNavigationController */,
9663F9661C7ADCB600AF0965 /* Products */, 9663F9661C7ADCB600AF0965 /* Products */,
); );
......
...@@ -77,7 +77,7 @@ class AppLeftViewController: UIViewController { ...@@ -77,7 +77,7 @@ class AppLeftViewController: UIViewController {
// Use MaterialLayout to easily align the tableView. // Use MaterialLayout to easily align the tableView.
view.addSubview(tableView) view.addSubview(tableView)
tableView.translatesAutoresizingMaskIntoConstraints = false tableView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(view, child: tableView, top: 170) MaterialLayout.alignToParent(view, child: tableView)
} }
} }
......
...@@ -40,7 +40,7 @@ import Material ...@@ -40,7 +40,7 @@ import Material
class ViewController: UIViewController, TextFieldDelegate { class ViewController: UIViewController, TextFieldDelegate {
private var nameField: TextField! private var nameField: TextField!
private var emailField: TextField! private var emailField: ErrorTextField!
private var passwordField: TextField! private var passwordField: TextField!
override func viewDidLoad() { override func viewDidLoad() {
...@@ -92,7 +92,6 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -92,7 +92,6 @@ class ViewController: UIViewController, TextFieldDelegate {
nameField.detail = "Your given name" nameField.detail = "Your given name"
nameField.textAlignment = .Center nameField.textAlignment = .Center
nameField.clearButtonMode = .WhileEditing nameField.clearButtonMode = .WhileEditing
nameField.delegate = self
// The translatesAutoresizingMaskIntoConstraints property must be set to enable AutoLayout correctly. // The translatesAutoresizingMaskIntoConstraints property must be set to enable AutoLayout correctly.
nameField.translatesAutoresizingMaskIntoConstraints = false nameField.translatesAutoresizingMaskIntoConstraints = false
...@@ -106,7 +105,7 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -106,7 +105,7 @@ class ViewController: UIViewController, TextFieldDelegate {
/// Prepares the email TextField. /// Prepares the email TextField.
private func prepareEmailField() { private func prepareEmailField() {
emailField = TextField(frame: CGRectMake(40, 120, view.bounds.width - 80, 32)) emailField = ErrorTextField(frame: CGRectMake(40, 120, view.bounds.width - 80, 32))
emailField.placeholder = "Email" emailField.placeholder = "Email"
emailField.detail = "Error, incorrect email" emailField.detail = "Error, incorrect email"
emailField.enableClearIconButton = true emailField.enableClearIconButton = true
...@@ -115,7 +114,6 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -115,7 +114,6 @@ class ViewController: UIViewController, TextFieldDelegate {
emailField.placeholderColor = MaterialColor.amber.darken4 emailField.placeholderColor = MaterialColor.amber.darken4
emailField.placeholderActiveColor = MaterialColor.pink.base emailField.placeholderActiveColor = MaterialColor.pink.base
emailField.dividerColor = MaterialColor.cyan.base emailField.dividerColor = MaterialColor.cyan.base
emailField.detailColor = MaterialColor.indigo.accent1
view.addSubview(emailField) view.addSubview(emailField)
} }
...@@ -127,7 +125,6 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -127,7 +125,6 @@ class ViewController: UIViewController, TextFieldDelegate {
passwordField.detail = "At least 8 characters" passwordField.detail = "At least 8 characters"
passwordField.clearButtonMode = .WhileEditing passwordField.clearButtonMode = .WhileEditing
passwordField.enableVisibilityIconButton = true passwordField.enableVisibilityIconButton = true
passwordField.delegate = self
// Setting the visibilityFlatButton color. // Setting the visibilityFlatButton color.
passwordField.visibilityIconButton?.tintColor = MaterialColor.green.base.colorWithAlphaComponent(passwordField.secureTextEntry ? 0.38 : 0.54) passwordField.visibilityIconButton?.tintColor = MaterialColor.green.base.colorWithAlphaComponent(passwordField.secureTextEntry ? 0.38 : 0.54)
...@@ -144,6 +141,7 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -144,6 +141,7 @@ class ViewController: UIViewController, TextFieldDelegate {
/// Executed when the 'return' key is pressed when using the emailField. /// Executed when the 'return' key is pressed when using the emailField.
func textFieldShouldReturn(textField: UITextField) -> Bool { func textFieldShouldReturn(textField: UITextField) -> Bool {
(textField as? ErrorTextField)?.revealError = true
return true return true
} }
...@@ -159,13 +157,16 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -159,13 +157,16 @@ class ViewController: UIViewController, TextFieldDelegate {
} }
func textFieldDidEndEditing(textField: UITextField) { func textFieldDidEndEditing(textField: UITextField) {
(textField as? ErrorTextField)?.revealError = false
} }
func textFieldShouldClear(textField: UITextField) -> Bool { func textFieldShouldClear(textField: UITextField) -> Bool {
(textField as? ErrorTextField)?.revealError = false
return true return true
} }
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
(textField as? ErrorTextField)?.revealError = false
return true return true
} }
} }
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.39.17' s.version = '1.40.0'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'An animation and graphics framework for Material Design in Swift.' s.summary = 'An animation and graphics framework for Material Design in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
961F18E81CD93E3E008927C5 /* ErrorTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F18E71CD93E3E008927C5 /* ErrorTextField.swift */; };
96334EF61C8B84660083986B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96334EF51C8B84660083986B /* Assets.xcassets */; }; 96334EF61C8B84660083986B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96334EF51C8B84660083986B /* Assets.xcassets */; };
963832421B88DFD80015F710 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963832361B88DFD80015F710 /* Material.framework */; }; 963832421B88DFD80015F710 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963832361B88DFD80015F710 /* Material.framework */; };
9658F2171CD6FA4700B902C1 /* IconButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9658F2161CD6FA4700B902C1 /* IconButton.swift */; }; 9658F2171CD6FA4700B902C1 /* IconButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9658F2161CD6FA4700B902C1 /* IconButton.swift */; };
...@@ -193,6 +194,7 @@ ...@@ -193,6 +194,7 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
961F18E71CD93E3E008927C5 /* ErrorTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorTextField.swift; sourceTree = "<group>"; };
96334EF51C8B84660083986B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96334EF51C8B84660083986B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
963832361B88DFD80015F710 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Material.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 963832361B88DFD80015F710 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Material.framework; sourceTree = BUILT_PRODUCTS_DIR; };
963832411B88DFD80015F710 /* Material.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Material.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 963832411B88DFD80015F710 /* Material.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Material.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
...@@ -581,6 +583,7 @@ ...@@ -581,6 +583,7 @@
children = ( children = (
96BCB79B1CB40DC500C806FE /* Text.swift */, 96BCB79B1CB40DC500C806FE /* Text.swift */,
96BCB79C1CB40DC500C806FE /* TextField.swift */, 96BCB79C1CB40DC500C806FE /* TextField.swift */,
961F18E71CD93E3E008927C5 /* ErrorTextField.swift */,
96BCB79D1CB40DC500C806FE /* TextStorage.swift */, 96BCB79D1CB40DC500C806FE /* TextStorage.swift */,
96BCB79E1CB40DC500C806FE /* TextView.swift */, 96BCB79E1CB40DC500C806FE /* TextView.swift */,
); );
...@@ -895,6 +898,7 @@ ...@@ -895,6 +898,7 @@
96BCB7C81CB40DC500C806FE /* MaterialLabel.swift in Sources */, 96BCB7C81CB40DC500C806FE /* MaterialLabel.swift in Sources */,
96BCB7A21CB40DC500C806FE /* BottomTabBar.swift in Sources */, 96BCB7A21CB40DC500C806FE /* BottomTabBar.swift in Sources */,
96BCB7BD1CB40DC500C806FE /* MaterialCollectionViewDelegate.swift in Sources */, 96BCB7BD1CB40DC500C806FE /* MaterialCollectionViewDelegate.swift in Sources */,
961F18E81CD93E3E008927C5 /* ErrorTextField.swift in Sources */,
96BCB7AF1CB40DC500C806FE /* Material+UIImage+Blank.swift in Sources */, 96BCB7AF1CB40DC500C806FE /* Material+UIImage+Blank.swift in Sources */,
96BCB7D01CB40DC500C806FE /* MaterialSpacing.swift in Sources */, 96BCB7D01CB40DC500C806FE /* MaterialSpacing.swift in Sources */,
96BCB7B31CB40DC500C806FE /* Material+UIImage+Resize.swift in Sources */, 96BCB7B31CB40DC500C806FE /* Material+UIImage+Resize.swift in Sources */,
......
...@@ -84,6 +84,7 @@ To help template your project, checkout our latest addition, Material Sticker Sh ...@@ -84,6 +84,7 @@ To help template your project, checkout our latest addition, Material Sticker Sh
#### Text #### Text
* [TextField](#textfield) * [TextField](#textfield)
* ErrorTextField
* [TextView](#textview) * [TextView](#textview)
#### Buttons #### Buttons
......
...@@ -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.39.17</string> <string>1.40.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
import UIKit import UIKit
public class ErrorTextField: TextField { public class ErrorTextField : TextField {
/// Controls the visibility of detailLabel /// Controls the visibility of detailLabel
@IBInspectable public var revealError: Bool = false { @IBInspectable public var revealError: Bool = false {
didSet { didSet {
...@@ -47,11 +46,8 @@ public class ErrorTextField: TextField { ...@@ -47,11 +46,8 @@ public class ErrorTextField: TextField {
when subclassing. when subclassing.
*/ */
override public func prepareView() { override public func prepareView() {
super.prepareView() super.prepareView()
detailLabel.hidden = true revealError = false
detailColor = MaterialColor.red.base detailColor = MaterialColor.red.base
} }
} }
...@@ -96,10 +96,15 @@ public struct MaterialDevice { ...@@ -96,10 +96,15 @@ public struct MaterialDevice {
} }
/// A Boolean indicating if the device is in Landscape mode. /// A Boolean indicating if the device is in Landscape mode.
public static var landscape: Bool { public static var isLandscape: Bool {
return UIApplication.sharedApplication().statusBarOrientation.isLandscape return UIApplication.sharedApplication().statusBarOrientation.isLandscape
} }
/// A Boolean indicating if the device is in Portrait mode.
public static var isPortrait: Bool {
return !MaterialDevice.isLandscape
}
/// The current UIInterfaceOrientation value. /// The current UIInterfaceOrientation value.
public static var orientation: UIInterfaceOrientation { public static var orientation: UIInterfaceOrientation {
return UIApplication.sharedApplication().statusBarOrientation return UIApplication.sharedApplication().statusBarOrientation
......
...@@ -340,7 +340,7 @@ public class NavigationBar : UINavigationBar { ...@@ -340,7 +340,7 @@ public class NavigationBar : UINavigationBar {
internal func sizeNavigationItem(item: UINavigationItem) { internal func sizeNavigationItem(item: UINavigationItem) {
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 = MaterialDevice.isLandscape ? item.landscapeInset : item.portraitInset
// leftControls // leftControls
if let v: Array<UIControl> = item.leftControls { if let v: Array<UIControl> = item.leftControls {
...@@ -398,7 +398,7 @@ public class NavigationBar : UINavigationBar { ...@@ -398,7 +398,7 @@ public class NavigationBar : UINavigationBar {
public func prepareView() { public func prepareView() {
barStyle = .Default barStyle = .Default
translucent = false translucent = false
backButtonImage = UIImage.imageWithColor(MaterialColor.clear, size: CGSizeMake(1, 1)) backButtonImage = nil
backgroundColor = MaterialColor.white backgroundColor = MaterialColor.white
depth = .Depth1 depth = .Depth1
contentInsetPreset = .Square1 contentInsetPreset = .Square1
......
...@@ -356,13 +356,18 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -356,13 +356,18 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
public override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { public override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator) super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
if !MaterialDevice.landscape && .iPhone == MaterialDevice.type { // Portrait will be Lanscape when this method is done.
if MaterialDevice.isPortrait && .iPhone == MaterialDevice.type {
hideStatusBar() hideStatusBar()
} else { } else {
showStatusBar() showStatusBar()
} }
closeLeftView()
closeRightView()
// Ensures the view is hidden.
if let v: MaterialView = rightView { if let v: MaterialView = rightView {
v.x = size.width - (openedRightView ? rightViewWidth : 0) v.position.x = size.width + v.width / 2
} }
} }
...@@ -972,7 +977,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -972,7 +977,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
private func showStatusBar() { private func showStatusBar() {
if statusBarHidden { if statusBarHidden {
willHideStatusBar = false willHideStatusBar = false
print("show")
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration), UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration),
animations: { [weak self] in animations: { [weak self] in
self?.setNeedsStatusBarAppearanceUpdate() self?.setNeedsStatusBarAppearanceUpdate()
...@@ -984,21 +988,22 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -984,21 +988,22 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/// Hides the statusBar. /// Hides the statusBar.
private func hideStatusBar() { private func hideStatusBar() {
if enableHideStatusbar && !statusBarHidden { if enableHideStatusbar {
willHideStatusBar = true willHideStatusBar = true
print("hide") if !statusBarHidden {
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration), UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration),
animations: { [weak self] in animations: { [weak self] in
self?.setNeedsStatusBarAppearanceUpdate() self?.setNeedsStatusBarAppearanceUpdate()
self?.statusBarHidden = true self?.statusBarHidden = true
}) })
delegate?.sideNavigationStatusBarHiddenState?(self, hidden: true) delegate?.sideNavigationStatusBarHiddenState?(self, hidden: true)
}
} }
} }
/// Toggles the statusBar /// Toggles the statusBar
private func toggleStatusBar() { private func toggleStatusBar() {
if opened || MaterialDevice.landscape && .iPhone == MaterialDevice.type { if opened || MaterialDevice.isLandscape && .iPhone == MaterialDevice.type {
hideStatusBar() hideStatusBar()
} else { } else {
showStatusBar() showStatusBar()
...@@ -1065,7 +1070,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -1065,7 +1070,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/// Layout subviews. /// Layout subviews.
private func layoutSubviews() { private func layoutSubviews() {
// toggleStatusBar()
if let v: MaterialView = leftView { if let v: MaterialView = leftView {
v.width = leftViewWidth v.width = leftViewWidth
v.height = view.bounds.height v.height = view.bounds.height
......
...@@ -77,7 +77,7 @@ public class StatusBarView : ControlView { ...@@ -77,7 +77,7 @@ public class StatusBarView : ControlView {
grid.axis.columns = Int(width / 56) grid.axis.columns = Int(width / 56)
// General alignment. // General alignment.
if .iPhone == MaterialDevice.type && MaterialDevice.landscape { if .iPhone == MaterialDevice.type && MaterialDevice.isLandscape {
if heightForStatusBar == rotationFactor { if heightForStatusBar == rotationFactor {
contentInset.top -= rotationFactor contentInset.top -= rotationFactor
rotationFactor = 0 rotationFactor = 0
...@@ -96,7 +96,7 @@ public class StatusBarView : ControlView { ...@@ -96,7 +96,7 @@ public class StatusBarView : ControlView {
} }
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
return CGSizeMake(MaterialDevice.width, .iPhone == MaterialDevice.type && MaterialDevice.landscape ? heightForLandscapeOrientation : heightForPortraitOrientation) return CGSizeMake(MaterialDevice.width, .iPhone == MaterialDevice.type && MaterialDevice.isLandscape ? heightForLandscapeOrientation : heightForPortraitOrientation)
} }
/** /**
......
...@@ -150,7 +150,7 @@ public class StatusBarViewController : UIViewController { ...@@ -150,7 +150,7 @@ public class StatusBarViewController : UIViewController {
let h: CGFloat = MaterialDevice.height let h: CGFloat = MaterialDevice.height
let q: CGFloat = UIApplication.sharedApplication().statusBarFrame.size.height let q: CGFloat = UIApplication.sharedApplication().statusBarFrame.size.height
if .iPhone == MaterialDevice.type && MaterialDevice.landscape { if .iPhone == MaterialDevice.type && MaterialDevice.isLandscape {
rootViewController.view.frame.origin.y = heightForLandscapeOrientation rootViewController.view.frame.origin.y = heightForLandscapeOrientation
rootViewController.view.frame.size.height = h - (heightForStatusBar >= q ? heightForLandscapeOrientation : q - heightForStatusBar - heightForLandscapeOrientation) rootViewController.view.frame.size.height = h - (heightForStatusBar >= q ? heightForLandscapeOrientation : q - heightForStatusBar - heightForLandscapeOrientation)
} else { } else {
......
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