Xcode 8 does not auto-complete for init methods

大兔子大兔子 提交于 2020-01-02 06:59:29

问题


I am having trouble getting Xcode 8 with Swift 3 to auto-complete common initialization methods, and was wondering if there is anything I could do to fix the situation.

Specifically, take something like:

let jsonString = String(data: jsonData, encoding: .utf8)

The initialization method String(data:, encoding:) will not populate.

Demo Video


回答1:


I find it useful to type the actual word .init before asking for code completion. Then later, I take it back out again.

Note that Xcode is very choosy; if you go too far and type .init( it won't work.

EDIT According to Apple, this problem is fixed in Xcode 10.



来源:https://stackoverflow.com/questions/42796212/xcode-8-does-not-auto-complete-for-init-methods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!