Search code examples
xcodeswift3xcode8

Xcode 8 does not auto-complete for init methods


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


Solution

  • 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.

    enter image description here

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