 	}
 	
 	/// Ahdnler when text value changed.
-	internal func textFieldValueChanged() {
-		if detailLabelAutoHideEnabled && !detailLabelHidden {
-			detailLabelHidden = true
-			MaterialAnimation.animationDisabled { [unowned self] in
-				self.bottomBorderLayer.backgroundColor = self.titleLabelActiveColor?.CGColor
-			}
-		}
-	}
+    internal func textFieldValueChanged() {
+        if detailLabelAutoHideEnabled && !detailLabelHidden {
+            detailLabelHidden = true
+            MaterialAnimation.animationDisabled { [unowned self] in
+                var activeColor: CGColor? = self.titleLabelActiveColor?.CGColor
+                
+                if let bottomBorderColor: CGColor = self.bottomBorderTitleActiveColor?.CGColor {
+                    activeColor = bottomBorderColor
+                }
+                
+                self.bottomBorderLayer.backgroundColor = activeColor
+            }
+        }
+    }
 	
 	/// Handler for text editing began.
-	internal func textFieldDidBegin() {
-		titleLabel?.textColor = titleLabelActiveColor
-		MaterialAnimation.animationDisabled { [unowned self] in
-			self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? self.titleLabelActiveColor?.CGColor : self.detailLabelActiveColor?.CGColor
-		}
-	}
+    internal func textFieldDidBegin() {
+        titleLabel?.textColor = titleLabelActiveColor
+        MaterialAnimation.animationDisabled { [unowned self] in
+            var titleActiveColor: CGColor? = self.titleLabelActiveColor?.CGColor
+            var detailActiveColor: CGColor? = self.detailLabelActiveColor?.CGColor
+            
+            if let bottomBorderColor: CGColor = self.bottomBorderTitleActiveColor?.CGColor {
+                titleActiveColor = bottomBorderColor
+            }
+            
+            if let bottomBorderColor: CGColor = self.bottomBorderDetailActiveColor?.CGColor {
+                detailActiveColor = bottomBorderColor
+            }
+            
+            self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? titleActiveColor : detailActiveColor
+        }
+    }
+
 	
 	/// Handler for text changed.
 	internal func textFieldDidChange() {

	The color of the detailLabel text when the detailLabelHidden property
	is set to false.
	*/
	@IBInspectable public var detailLabelActiveColor: UIColor? {
		didSet {
			if !detailLabelHidden {
				detailLabel?.textColor = detailLabelActiveColor
				MaterialAnimation.animationDisabled { [unowned self] in
					self.bottomBorderLayer.backgroundColor = self.detailLabelActiveColor?.CGColor
				}
			}
		}
	}
	
	/**
	A property that sets the distance between the textField and

	/**
	:name:	detailLabelHidden
	*/
    @IBInspectable public var detailLabelHidden: Bool = true {
        didSet {
            if detailLabelHidden {
                detailLabel?.textColor = titleLabelColor
                MaterialAnimation.animationDisabled { [unowned self] in
                    var activeColor: CGColor? = self.titleLabelActiveColor?.CGColor
                    var inactiveColor: CGColor? = self.titleLabelColor?.CGColor
                    
                    if let bottomBorderColor: CGColor = self.bottomBorderTitleActiveColor?.CGColor {
                        activeColor = bottomBorderColor
                    }
                    
                    if let bottomBorderColor: CGColor = self.bottomBorderColor?.CGColor {
                        inactiveColor = bottomBorderColor
                    }
                    
                    self.bottomBorderLayer.backgroundColor = self.editing ? activeColor : inactiveColor
                }
                hideDetailLabel()
            } else {
                detailLabel?.textColor = detailLabelActiveColor
                MaterialAnimation.animationDisabled { [unowned self] in
                    var activeColor: CGColor? = self.detailLabelActiveColor?.CGColor
                    
                    if let bottomBorderColor: CGColor = self.bottomBorderDetailActiveColor?.CGColor {
                        activeColor = bottomBorderColor
                    }
                    
                    self.bottomBorderLayer.backgroundColor = activeColor
                }
                showDetailLabel()
            }
        }
    }
	
	/// A wrapper for searchBar.placeholder.
	@IBInspectable public override var placeholder: String? {
