1

First I thought Xcode is buggy so I restarted Xcode, but the problem stayed even after rebooting the mac. I then figured out, that a semicolon after .default or the declaration of another variable fixes it.

I think Xcode thinks the assignment isn't over after .default, but I'm curious if there is more to it / a better explanation why that is.

func setupNotificationHandling() {

    let notificationCenter = NotificationCenter.default

    // Can't access notificationCenter via autocompletion here
}
Tysac
  • 257
  • 2
  • 11
  • Confirmed, also happens in Xcode 9.3 beta. Looks like a bug to me. Apparently Xcode offers only methods that can be called on `NotificationCenter.default` – as if you had typed a dot after it. – Martin R Mar 01 '18 at 21:53

0 Answers0