Last active
May 17, 2018 13:09
-
-
Save RockinPaul/c302d04c05674aac7396d1322581036a to your computer and use it in GitHub Desktop.
UITextField padding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var textField: UITextField! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: 15, height: textField.frame.height)) | |
textField.leftView = paddingView | |
textField.leftViewMode = UITextFieldViewMode.always | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment