Xcode 8.0 Swift 3.0 slow indexing and building

后端 未结 16 2150
天涯浪人
天涯浪人 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:27

    I solved the problem by commenting all files and then removing comments one by one. I found that the problem is still in the array declaration as described here.

    I had code like this and project was not indexing:

    class {
        var first: String!
        var second: String!
        var third: String!
        var fourth: String!
        var fifth: String!
    
        func abc() -> [String] {
            var array = [first, second, third, fourth, fifth]
        }
    }
    

    I've changed it to this and indexing started working:

    class {
        var first: String!
        var second: String!
        var third: String!
        var fourth: String!
        var fifth: String!
    
        func abc() -> [String] {
            var array = [first]
    
            array.append(second)
            array.append(third)
            array.append(fourth)
            array.append(fifth)
        }
    }
    

提交回复
热议问题