Commit 471c38bd by Daniel Dahan

updated before using UISearchBar

parent db8f6f19
......@@ -20,6 +20,16 @@ import UIKit
public class SearchBarView : MaterialView, UITextFieldDelegate {
/**
:name: internalBackgroundColor
*/
internal var internalBackgroundColor: UIColor?
/**
:name: editingBackgroundColor
*/
public var editingBackgroundColor: UIColor?
/**
:name: statusBarStyle
*/
public var statusBarStyle: MaterialStatusBarStyle! {
......@@ -294,12 +304,15 @@ public class SearchBarView : MaterialView, UITextFieldDelegate {
}
public func textFieldShouldBeginEditing(textField: UITextField) -> Bool {
backgroundColor = MaterialColor.white
if let v: UIColor = editingBackgroundColor {
internalBackgroundColor = backgroundColor
backgroundColor = v
}
return true
}
public func textFieldShouldEndEditing(textField: UITextField) -> Bool {
backgroundColor = MaterialColor.blue.accent3
backgroundColor = internalBackgroundColor
return true
}
}
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