美文网首页iOS开发程序员
init(start: end) is deprecated:

init(start: end) is deprecated:

作者: OSong | 来源:发表于2016-08-14 17:05 被阅读59次

    Swift3.0中的更新提示
    init(start: end) is deprecated: it will be removed in Swift 3. Use the '..<' operator

    init(start: end) is deprecated: it will be removed in Swift 3. Use the '..<' operator
    

    这个提示就是让你把代码形式修改改为如下形式
    Swift3.0以前写法

    s2.removeRange(Range(start: s2.startIndex.advancedBy(1), end: s2.startIndex.advancedBy(3)))
    

    Swift3.0后 写成如下格式

    s2.removeRange(Range(s2.startIndex.advancedBy(1)..<s2.startIndex.advancedBy(4)))
    
    sss.png

    相关文章

      网友评论

        本文标题:init(start: end) is deprecated:

        本文链接:https://www.haomeiwen.com/subject/ljiysttx.html