‘'advance’API已在Swift 2.0中删除。
如果我们在Swift 2.0中使用'advance‘API,它会抛出错误'advance' is unavailable: call the '**advancedBy(n)**' method on the index
。
如何使用Swift 2.0中的advancedBy应用程序接口获取索引?
下面是我的场景:
let startIndex = advance(cardNumber.endIndex, -4)
let lastFourDigitsOfPhoneNumber = phoneNumber.substringFromIndex(startIndex)
https://stackoverflow.com/questions/32237243
复制相似问题