Last active
May 14, 2016 02:31
-
-
Save RobAWilkinson/8c5d8126b8afe92e4e429464f41b54d8 to your computer and use it in GitHub Desktop.
This only draws one rectangle
This file contains hidden or 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
@IBOutlet var signupFields: [UITextField]! | |
for field in signupFields { | |
let rect = CGRectMake(0, 0, 100, 100) | |
let rectUI = UIView(frame: rect) | |
rectUI.backgroundColor = UIColor.redColor() | |
field.leftView = rectUI | |
field.leftViewMode = UITextFieldViewMode.UnlessEditing | |
} |
This file contains hidden or 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
@IBOutlet weak var firstNameTextField: UITextField! | |
@IBOutlet weak var lastNameTextField: UITextField! | |
@IBOutlet weak var emailTextField: UITextField! | |
@IBOutlet weak var passwordTextField: UITextField! | |
var rect = CGRectMake(0, 0, 100, 100) | |
var rectUI = UIView(frame: rect) | |
rectUI.backgroundColor = UIColor.redColor() | |
firstNameTextField.leftView = rectUI | |
firstNameTextField.leftViewMode = UITextFieldViewMode.UnlessEditing | |
rect = CGRectMake(0, 0, 100, 100) | |
rectUI = UIView(frame: rect) | |
rectUI.backgroundColor = UIColor.redColor() | |
lastNameTextField.leftView = rectUI | |
lastNameTextField.leftViewMode = UITextFieldViewMode.UnlessEditing | |
rect = CGRectMake(0, 0, 100, 100) | |
rectUI = UIView(frame: rect) | |
rectUI.backgroundColor = UIColor.redColor() | |
emailTextField.leftView = rectUI | |
emailTextField.leftViewMode = UITextFieldViewMode.UnlessEditing | |
rect = CGRectMake(0, 0, 100, 100) | |
rectUI = UIView(frame: rect) | |
rectUI.backgroundColor = UIColor.redColor() | |
passwordTextField.leftView = rectUI | |
passwordTextField.leftViewMode = UITextFieldViewMode.UnlessEditing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment