I was using this code scope previously:
override func textRect(forBounds bounds: CGRect) -> CGRect {
super.textRect(forBounds: bounds)
return UIEdgeInsetsInsetRect(bounds, UIEdgeInsets(top: 0,left: 10, bottom: 0, right: 10))
}
But it gives an error after Xcode, Swift Update. Here is an error:
'UIEdgeInsetsInsetRect' has been replaced by instance method 'CGRect.inset(by:)'
And then i wrote this:
override func textRect(forBounds bounds: CGRect) -> CGRect {
super.textRect(forBounds: bounds)
var animationRect = frame.inset(by: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 10))
return animationRect
}
But the above code doesn't affect into the text field. What should I write to give a padding from left?