My question is as simple as the title, but here\'s a little more:
I have a UITextField, on which I\'ve set the background image. The problem is that the text hugs so
I turned this into a nice little extension for use inside Storyboards:
public extension UITextField {
@IBInspectable public var leftSpacer:CGFloat {
get {
return leftView?.frame.size.width ?? 0
} set {
leftViewMode = .Always
leftView = UIView(frame: CGRect(x: 0, y: 0, width: newValue, height: frame.size.height))
}
}
}