UITextField And UILabel Tips
UITextField Tips
Add a top Line on Keyboard
1 | extension UITextField { |
Only allowed a price number with exactly two decimals
1 | func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { |
Only allowed 1-100 or leave blank
1 | func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { |
UILabel Tips
Formate cell-phone number to 111 1111 111
1 | extension String { |
Highlight UILabel’s substring by given string
1 | var userInputPhoneNumber = "123" |