18
に変換できません。タイプ 'NSRange'(別名 '_NSRange')の値を期待値タイプ 'Range <Index>'(別名「Range <String.CharacterView.Index>」)
@objc func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
let shouldChange = false
let text = textField.text
var newString = text!.stringByReplacingCharactersInRange(range, withString: string) as? NSString
if newString.length > 14{
newString = newString.substringToIndex(14)
}
textField.text = newString.uppercaseString
return shouldChange
}
[NSRange to Range](http://stackoverflow.com/questions/25138339/nsn-to-rangestring-index)を比較してください。 –