Haitham Maaieh Haitham Maaieh - 1 month ago 11
Swift Question

Xcode Autocomplete Member From Class Extension

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.

Answer

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