我如何在Swift中转换NSRange
到Range<String.Index>
?
我想使用下面的UITextFieldDelegate
方法:
func textField(textField: UITextField!,
shouldChangeCharactersInRange range: NSRange,
replacementString string: String!) -> Bool {
textField.text.stringByReplacingCharactersInRange(???, withString: string)