Commit 61fd93ca by Daniel Dahan Committed by GitHub

Merge branch 'development' into feature/text-field-label-sizes

parents f347a0b2 f48c068c
...@@ -211,19 +211,23 @@ open class TextField: UITextField { ...@@ -211,19 +211,23 @@ open class TextField: UITextField {
/// This property adds a padding to placeholder y position animation /// This property adds a padding to placeholder y position animation
@IBInspectable @IBInspectable
open var placeholderVerticalOffset: CGFloat = 0 open var placeholderVerticalOffset: CGFloat = 0
/// The scale of the active placeholder in relation to the inactive /// This property adds a padding to placeholder y position animation
@IBInspectable @IBInspectable
open var placeholderActiveScale: CGFloat = 0.75 { open var placeholderHorizinalOffset: CGFloat = 0
didSet {
layoutPlaceholderLabel()
}
}
/// The scale of the active placeholder in relation to the inactive
@IBInspectable
open var placeholderActiveScale: CGFloat = 0.75 {
didSet {
layoutPlaceholderLabel()
}
}
/// The detailLabel UILabel that is displayed. /// The detailLabel UILabel that is displayed.
@IBInspectable @IBInspectable
open let detailLabel = UILabel() open let detailLabel = UILabel()
/// The detailLabel text value. /// The detailLabel text value.
@IBInspectable @IBInspectable
...@@ -513,9 +517,9 @@ fileprivate extension TextField { ...@@ -513,9 +517,9 @@ fileprivate extension TextField {
switch textAlignment { switch textAlignment {
case .left, .natural: case .left, .natural:
placeholderLabel.x = w placeholderLabel.x = w + placeholderHorizinalOffset
case .right: case .right:
placeholderLabel.x = width - placeholderLabel.width - textInset placeholderLabel.x = width - placeholderLabel.width - textInset + placeholderHorizinalOffset
default:break default:break
} }
...@@ -650,9 +654,9 @@ extension TextField { ...@@ -650,9 +654,9 @@ extension TextField {
switch s.textAlignment { switch s.textAlignment {
case .left, .natural: case .left, .natural:
s.placeholderLabel.x = s.leftViewWidth + s.textInset s.placeholderLabel.x = s.leftViewWidth + s.textInset + s.placeholderHorizinalOffset
case .right: case .right:
s.placeholderLabel.x = s.width - s.placeholderLabel.width - s.textInset s.placeholderLabel.x = s.width - s.placeholderLabel.width - s.textInset + s.placeholderHorizinalOffset
default:break default:break
} }
......
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