Xcode 8.1 swift 3 take forever to compile this code

后端 未结 3 905
萌比男神i
萌比男神i 2021-01-24 05:01

I have this class in a project which previously use swift 2.3. When i migrated the project to swift 3, xcode took forever to compile and i saw it stuck at this class. I can not

3条回答
  •  天涯浪人
    2021-01-24 05:30

    Rewrite without the big dictionary literal. So:

    func toAnyObject() -> Any {
        var d = [String:Any]()
        d["id"] = id
        d["uid"] = uid
        // ... and so on ...
        return d
    }
    

提交回复
热议问题