Commit a9bd393e by Daniel Dahan

prepare for release

parent e2322500
......@@ -100,6 +100,7 @@ class ViewController: UIViewController, TextFieldDelegate {
textField.detailLabel!.text = "Email is incorrect."
textField.detailLabel!.font = RobotoFont.mediumWithSize(12)
textField.detailLabelActiveColor = MaterialColor.red.accent3
textField.detailLabelAutoHideEnabled = false // Comment out this line to have automatic hiding.
let image = UIImage(named: "ic_close_white")?.imageWithRenderingMode(.AlwaysTemplate)
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.34.3'
s.version = '1.34.4'
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.homepage = 'http://cosmicmind.io'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.34.3</string>
<string>1.34.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -48,6 +48,22 @@ public extension UIViewController {
}
}
@objc(NavigationBarViewControllerDelegate)
public protocol NavigationBarViewControllerDelegate : MaterialDelegate {
/// Delegation method that executes when the floatingViewController will open.
optional func navigationBarViewControllerWillOpenFloatingViewController(navigationBarViewController: NavigationBarViewController)
/// Delegation method that executes when the floatingViewController will close.
optional func navigationBarViewControllerWillCloseFloatingViewController(navigationBarViewController: NavigationBarViewController)
/// Delegation method that executes when the floatingViewController did open.
optional func navigationBarViewControllerDidOpenFloatingViewController(navigationBarViewController: NavigationBarViewController)
/// Delegation method that executes when the floatingViewController did close.
optional func navigationBarViewControllerDidCloseFloatingViewController(navigationBarViewController: NavigationBarViewController)
}
@objc(NavigationBarViewController)
public class NavigationBarViewController: StatusBarViewController {
/// Internal reference to the floatingViewController.
private var internalFloatingViewController: UIViewController?
......@@ -55,6 +71,9 @@ public class NavigationBarViewController: StatusBarViewController {
/// Reference to the NavigationBarView.
public private(set) lazy var navigationBarView: NavigationBarView = NavigationBarView()
/// Delegation handler.
public weak var delegate: NavigationBarViewControllerDelegate?
/// A floating UIViewController.
public var floatingViewController: UIViewController? {
get {
......@@ -62,6 +81,7 @@ public class NavigationBarViewController: StatusBarViewController {
}
set(value) {
if let v: UIViewController = internalFloatingViewController {
delegate?.navigationBarViewControllerWillCloseFloatingViewController?(self)
internalFloatingViewController = nil
UIView.animateWithDuration(0.5,
animations: { [unowned self] in
......@@ -74,6 +94,9 @@ public class NavigationBarViewController: StatusBarViewController {
v.removeFromParentViewController()
self.userInteractionEnabled = true
self.navigationBarView.userInteractionEnabled = true
dispatch_async(dispatch_get_main_queue()) { [unowned self] in
self.delegate?.navigationBarViewControllerDidCloseFloatingViewController?(self)
}
}
}
......@@ -92,12 +115,17 @@ public class NavigationBarViewController: StatusBarViewController {
internalFloatingViewController = v
userInteractionEnabled = false
navigationBarView.userInteractionEnabled = false
delegate?.navigationBarViewControllerWillOpenFloatingViewController?(self)
UIView.animateWithDuration(0.5,
animations: { [unowned self] in
v.view.center.y = self.view.bounds.height / 2
self.navigationBarView.alpha = 0.5
self.mainViewController.view.alpha = 0.5
})
}) { [unowned self] _ in
dispatch_async(dispatch_get_main_queue()) { [unowned self] in
self.delegate?.navigationBarViewControllerDidOpenFloatingViewController?(self)
}
}
}
}
}
......
......@@ -338,6 +338,12 @@ public class TextField : UITextField {
public var detailLabelAnimationDistance: CGFloat = 8
/**
A Boolean that indicates the detailLabel should hide
automatically when text changes.
*/
public var detailLabelAutoHideEnabled: Bool = true
/**
:name: detailLabelHidden
*/
public var detailLabelHidden: Bool = true {
......@@ -489,7 +495,7 @@ public class TextField : UITextField {
/// Ahdnler when text value changed.
internal func textFieldValueChanged() {
if !detailLabelHidden {
if detailLabelAutoHideEnabled && !detailLabelHidden {
detailLabelHidden = true
MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.titleLabelActiveColor?.CGColor
......
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