I have this code in objective-c:
[textField.text stringByReplacingCharactersInRange:range withString:string];
try to convert to swift, like so:
textField.text.stringByReplacingCharactersInRange(range, withString: string)
but compiler says, Int is not identical to 'String.index'
How should I modify expression?
I am using both objective-c / swift expressions in UITextFieldDelegate method:
func textField(textField: UITextField!,
shouldChangeCharactersInRange range: NSRange,
replacementString string: String!) -> Bool {