UITextField

Usage

let textField = UITextField()

// Placeholder
textField.placeholder = "Placeholder"

// 样式,borderStyle 会覆盖 cornerRadius.
textField.borderStyle = .RoundedRect

textField.clearButtonMode = .WhileEditing

textField.keyboardType = .EmailAddress

// 鍵盤上的 return 鍵樣式 這邊選擇 Done
textField.returnKeyType = .Done

// 輸入文字的顏色
textField.textColor = UIColor.whiteColor()

// UITextField 的背景顏色
textField.backgroundColor = UIColor.lightGrayColor()