Xcode 8.0 Swift 3.0 slow indexing and building

后端 未结 16 2120
天涯浪人
天涯浪人 2020-12-07 17:12

I\'ve installed Xcode 8.0 and converted Swift 2.2 to 3.0 (that process also took a lot of time, I just left my Mac running all night). I have not a big project (about 20 fil

16条回答
  •  庸人自扰
    2020-12-07 17:29

    I had the same problem and solved it by painstakingly going through my code line by line, it turns out Swift 3 prefers string interpolation rather than using the + symbol, i.e.

    let url = "http://yahoo.com" + "someWebPage" + "whereItsInteresting" 
    

    If you have been using the above style of code replace it for;

    let url = "http://yahoo.com\(someWebPage)\(whereItsInteresting)"
    

    And your build time will immediately come back to normal.

提交回复
热议问题