The email icon and placeholder text are hugging each other.
I want to add some space between them.
Below is the code I am using to create these fields.
// view for fields background
var view = UIView(frame: CGRectMake(35, 300, 300, 90));
view.backgroundColor = UIColor.whiteColor();
view.layer.cornerRadius = 5.0
// email text field
var email = UITextField(frame: CGRectMake(0, 0, 300, 50));
email.backgroundColor = UIColor.whiteColor();
var emailIcon = UIImageView();
var emailIconImage = UIImage(named: "email_icon.png");
emailIcon.image = emailIconImage;
email.leftView = emailIcon;
email.leftViewMode = UITextFieldViewMode.Always
email.layer.cornerRadius=5.0;
email.attributedPlaceholder = NSAttributedString(string:"E-mail",
attributes:[NSForegroundColorAttributeName: UIColor.grayColor()])
emailIcon.frame = CGRect(x: 30, y: 15, width: 30, height: 20)
view.addSubview(emailIcon)
Thanks!