how to remove first character from textfield value in swift

Advertisements if my textfield takes 11 characters then i need to remove first character and then pass it to jason perameter, so i tried like below var dropFirst: String? if emailPhoneTextField.text?.count == 11{ dropFirst = emailPhoneTextField.text?.dropFirst() emailPhoneTextField.text = dropFirst } then o/p: then error, how to fix Cannot assign value of type ‘String.SubSequence?’ (aka ‘Optional’)… Read More how to remove first character from textfield value in swift

Function in textFieldDidEndEditing is running when it’s not supposed to run

Advertisements I’ve got 5 text fields: When I type values in any 4 of the text fields, the value should be calculated and it should appear in the 5th text field. For example, if I enter values in the Interest, Monthly Payment, Future Value and Number of Payments text fields, a value should be calculated… Read More Function in textFieldDidEndEditing is running when it’s not supposed to run