我怎么能转换NSRange
到Range<String.Index>
斯威夫特?
我想使用以下UITextFieldDelegate
方法:
func textField(textField: UITextField!,
shouldChangeCharactersInRange range: NSRange,
replacementString string: String!) -> Bool {
textField.text.stringByReplacingCharactersInRange(???, withString: string)
Run Code Online (Sandbox Code Playgroud)