Commit a4e83f20 by Daniel Dahan

fixed issue-332

parent 49c98d26
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
9663F94C1C7A74C700AF0965 /* AppMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94B1C7A74C700AF0965 /* AppMenuViewController.swift */; }; 9663F94C1C7A74C700AF0965 /* AppMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94B1C7A74C700AF0965 /* AppMenuViewController.swift */; };
9663F94E1C7A74EA00AF0965 /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */; }; 9663F94E1C7A74EA00AF0965 /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */; };
9663F9521C7A751D00AF0965 /* ItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9511C7A751D00AF0965 /* ItemViewController.swift */; }; 9663F9521C7A751D00AF0965 /* ItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9511C7A751D00AF0965 /* ItemViewController.swift */; };
9679CEC21CC92C1F0021685B /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9679CEC11CC92C1F0021685B /* Material.framework */; };
9679CEC31CC92C1F0021685B /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9679CEC11CC92C1F0021685B /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96CC08881C7FEBD60034FF84 /* RecipesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */; }; 96CC08881C7FEBD60034FF84 /* RecipesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -30,7 +28,6 @@ ...@@ -30,7 +28,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
9679CEC31CC92C1F0021685B /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -51,7 +48,6 @@ ...@@ -51,7 +48,6 @@
9663F94B1C7A74C700AF0965 /* AppMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppMenuViewController.swift; sourceTree = "<group>"; }; 9663F94B1C7A74C700AF0965 /* AppMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppMenuViewController.swift; sourceTree = "<group>"; };
9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppLeftViewController.swift; sourceTree = "<group>"; }; 9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppLeftViewController.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>"; };
9679CEC11CC92C1F0021685B /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/Build/Products/Debug-iphonesimulator/Material.framework"; sourceTree = "<absolute>"; };
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>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -60,7 +56,6 @@ ...@@ -60,7 +56,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9679CEC21CC92C1F0021685B /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -70,7 +65,6 @@ ...@@ -70,7 +65,6 @@
9663F9251C7A744500AF0965 = { 9663F9251C7A744500AF0965 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9679CEC11CC92C1F0021685B /* Material.framework */,
9663F9301C7A744600AF0965 /* App */, 9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */, 9663F92F1C7A744600AF0965 /* Products */,
); );
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
966F57A31C226BAA009185B7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57A21C226BAA009185B7 /* ViewController.swift */; }; 966F57A31C226BAA009185B7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57A21C226BAA009185B7 /* ViewController.swift */; };
966F57A81C226BAA009185B7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 966F57A71C226BAA009185B7 /* Assets.xcassets */; }; 966F57A81C226BAA009185B7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 966F57A71C226BAA009185B7 /* Assets.xcassets */; };
966F57AB1C226BAA009185B7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 966F57A91C226BAA009185B7 /* LaunchScreen.storyboard */; }; 966F57AB1C226BAA009185B7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 966F57A91C226BAA009185B7 /* LaunchScreen.storyboard */; };
9679CEBF1CC926970021685B /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9679CEBE1CC926970021685B /* Material.framework */; };
9679CEC01CC926970021685B /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9679CEBE1CC926970021685B /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -22,7 +20,6 @@ ...@@ -22,7 +20,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
9679CEC01CC926970021685B /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -36,7 +33,6 @@ ...@@ -36,7 +33,6 @@
966F57A71C226BAA009185B7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 966F57A71C226BAA009185B7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
966F57AA1C226BAA009185B7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 966F57AA1C226BAA009185B7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
966F57AC1C226BAA009185B7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 966F57AC1C226BAA009185B7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9679CEBE1CC926970021685B /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/Build/Products/Debug-iphonesimulator/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -44,7 +40,6 @@ ...@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9679CEBF1CC926970021685B /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -54,7 +49,6 @@ ...@@ -54,7 +49,6 @@
966F57941C226BAA009185B7 = { 966F57941C226BAA009185B7 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9679CEBE1CC926970021685B /* Material.framework */,
966F579F1C226BAA009185B7 /* TextField */, 966F579F1C226BAA009185B7 /* TextField */,
966F579E1C226BAA009185B7 /* Products */, 966F579E1C226BAA009185B7 /* Products */,
); );
......
...@@ -58,7 +58,6 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -58,7 +58,6 @@ class ViewController: UIViewController, TextFieldDelegate {
private func prepareNameField() { private func prepareNameField() {
nameField = TextField() nameField = TextField()
nameField.placeholder = "Name" nameField.placeholder = "Name"
nameField.delegate = self
view.addSubview(nameField) view.addSubview(nameField)
nameField.translatesAutoresizingMaskIntoConstraints = false nameField.translatesAutoresizingMaskIntoConstraints = false
...@@ -89,8 +88,7 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -89,8 +88,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 {
emailField.text = nil (textField as! TextField).detailLabelHidden = 0 == textField.text?.utf16.count
// (textField as! TextField).detailLabelHidden = 0 == textField.text?.utf16.count
return true return true
} }
......
...@@ -68,9 +68,8 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -68,9 +68,8 @@ class ViewController: UIViewController, TextFieldDelegate {
Used to display the error message, which is displayed when Used to display the error message, which is displayed when
the user presses the 'return' key. the user presses the 'return' key.
*/ */
emailField.detailLabel = UILabel() emailField.detailLabel.text = "Email is incorrect."
emailField.detailLabel!.text = "Email is incorrect." emailField.detailLabel.font = RobotoFont.regularWithSize(12)
emailField.detailLabel!.font = RobotoFont.regularWithSize(12)
emailField.detailLabelActiveColor = MaterialColor.red.accent3 emailField.detailLabelActiveColor = MaterialColor.red.accent3
// emailField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding. // emailField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding.
} }
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.39.15' s.version = '1.39.16'
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'
......
...@@ -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.15</string> <string>1.39.16</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -34,6 +34,9 @@ public protocol TextFieldDelegate : UITextFieldDelegate {} ...@@ -34,6 +34,9 @@ public protocol TextFieldDelegate : UITextFieldDelegate {}
@IBDesignable @IBDesignable
public class TextField : UITextField { public class TextField : UITextField {
/// A boolean that indicates if the titleLabel is animating.
private var titleLabelAnimating: Bool = false
/// A reference to the placeholder value. /// A reference to the placeholder value.
private var placeholderText: String? private var placeholderText: String?
...@@ -362,14 +365,6 @@ public class TextField : UITextField { ...@@ -362,14 +365,6 @@ public class TextField : UITextField {
} }
} }
/// An override to the text property.
// @IBInspectable public override var text: String? {
// didSet {
// handleValueChanged()
// handleEditingDidEnd()
// }
// }
/// Sets the placeholder value. /// Sets the placeholder value.
@IBInspectable public override var placeholder: String? { @IBInspectable public override var placeholder: String? {
get { get {
...@@ -403,7 +398,10 @@ public class TextField : UITextField { ...@@ -403,7 +398,10 @@ public class TextField : UITextField {
/// An override to the text property. /// An override to the text property.
@IBInspectable public override var text: String? { @IBInspectable public override var text: String? {
didSet { didSet {
sendActionsForControlEvents(.ValueChanged)
if nil != oldValue && true == text?.isEmpty && !editing {
handleEditingDidEnd()
}
} }
} }
...@@ -508,6 +506,7 @@ public class TextField : UITextField { ...@@ -508,6 +506,7 @@ public class TextField : UITextField {
*/ */
public func prepareView() { public func prepareView() {
masksToBounds = false masksToBounds = false
borderStyle = .None
backgroundColor = MaterialColor.white backgroundColor = MaterialColor.white
textColor = MaterialColor.darkText.primary textColor = MaterialColor.darkText.primary
font = RobotoFont.regularWithSize(16) font = RobotoFont.regularWithSize(16)
...@@ -532,7 +531,6 @@ public class TextField : UITextField { ...@@ -532,7 +531,6 @@ public class TextField : UITextField {
return return
} }
text = nil text = nil
handleValueChanged()
} }
/// Ahdnler when text value changed. /// Ahdnler when text value changed.
...@@ -554,7 +552,7 @@ public class TextField : UITextField { ...@@ -554,7 +552,7 @@ public class TextField : UITextField {
/// Handler for text editing ended. /// Handler for text editing ended.
internal func handleEditingDidEnd() { internal func handleEditingDidEnd() {
if true == text?.isEmpty { if true == text?.isEmpty && !titleLabelAnimating {
hideTitleLabel() hideTitleLabel()
} }
titleLabel.textColor = titleLabelColor titleLabel.textColor = titleLabelColor
...@@ -657,6 +655,7 @@ public class TextField : UITextField { ...@@ -657,6 +655,7 @@ public class TextField : UITextField {
/// Hides and animates the titleLabel property. /// Hides and animates the titleLabel property.
private func hideTitleLabel() { private func hideTitleLabel() {
titleLabelAnimating = true
UIView.animateWithDuration(0.15, animations: { [weak self] in UIView.animateWithDuration(0.15, animations: { [weak self] in
if let s: TextField = self { if let s: TextField = self {
s.titleLabel.transform = CGAffineTransformIdentity s.titleLabel.transform = CGAffineTransformIdentity
...@@ -666,6 +665,7 @@ public class TextField : UITextField { ...@@ -666,6 +665,7 @@ public class TextField : UITextField {
if let s: TextField = self { if let s: TextField = self {
s.titleLabel.hidden = true s.titleLabel.hidden = true
s.placeholder = s.placeholderText s.placeholder = s.placeholderText
s.titleLabelAnimating = false
} }
} }
} }
......
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