1

Autocomplete isn't working for me when accessing members from a class extension in Xcode (6.3.2).

I made a UIColor extension, and I am accessing them via UIColor().sampleExtendedColorName(), and it does not show up while I'm typing. Autocomplete works for everything other than this. Is there a setting I can change?

extension UIColor{
func sampleExtendedColorName() -> UIColor {
    return UIColor(red:200/255, green:100/255, blue:120/255, alpha:1.0)
}
}

Update (new info): So autocomplete is working if I access the UIColors from a ViewController that directly subclasses UIViewController, but if I subclass a custom CustomViewController that is a subclass of UIViewController, autocomplete doesn't show up for some reason.

haitham
  • 3,398
  • 6
  • 21
  • 35

2 Answers2

1

Checking all the Target Memberships is working fine. If you don't know where the Target Membership is,

  • Go to your swift file (Eg: ViewController.swift)
  • On the right side in the Utilities panel, Click file inspector
  • You can see Target Membership there.
  • Check all the fields.
bradd123
  • 131
  • 1
  • 3
0

Figured it out, issue was on my ColorExtension.Swift file in my Xcode project. I needed to check all the Target Memberships.

haitham
  • 3,398
  • 6
  • 21
  • 35