How can I convert NSRange to Range in Swift?
NSRange
Range
I want to use the following UITextFieldDelegate method:
UITextFieldDelegate
In Swift 2.0 assuming func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {:
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
var oldString = textfield.text! let newRange = oldString.startIndex.advancedBy(range.location)..