问题
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