I have two C functions:
extern UIColor* LNRandomDarkColor();
extern UIColor* LNRandomLightColor();
As an exercise, I am trying to import them into Swift as extension methods to UIColor
.
Following Apple's "What's New in Swift" presentation from WWDC 2016 example:
void CGContextFillPath(CGContextRef) NS_SWIFT_NAME(CGContext.fillPath(self:));
I attempted to annotate my functions similarly:
extern UIColor* LNRandomDarkColor() NS_SWIFT_NAME(UIColor.randomDarkColor());
extern UIColor* LNRandomLightColor() NS_SWIFT_NAME(UIColor.randomLightColor());
However I am receiving the following warning:
'swift_name' attribute can only be applied to function declarations with prototypes
What am I doing wrong here?
Update: Opened SR-2999 for this issue.