I want the keyboard for the UITextfield to only have a-z, no numbers, no special characters (!@$!@$@!#), and no caps. Basicly I am going for a keyboard with only the alphabet.>
if isValidInput(Input: yourtextfieldOutletName.text!) == false {
let alert = UIAlertController(title: "", message;"Name field accepts only alphabatics", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
func isValidInput(Input:String) -> Bool {
let myCharSet=CharacterSet(charactersIn:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
let output: String = Input.trimmingCharacters(in: myCharSet.inverted)
let isValid: Bool = (Input == output)
print("\(isValid)")
return isValid
}