Okay the Xcode 7 GM is out and of course that means I have perfectly good swift 2.0 code from last week that doesn't work today. I'm converting a range passed into a textfield delegate method to a swift range and I'm stuck. Any help would be appreciated. So far I understand that the Global advance() method is gone and we should be using the new extension method advancedBY instead but I'm not sure how that fits into this situation. Here is my code that worked yesterday.....
// MARK: - Textfield Delegate
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
// Convert the NSRange into a Swift Range
let start = advance(textField.text!.startIndex, range.location)
let end = advancedBy(range.length)
let swiftRange = Range<String.Index>(start: start, end: end)
let text = textField.text!.stringByReplacingCharactersInRange(swiftRange, withString: string)
// Rest of the method here
}