My iOS project contains both objective-c code and swift code.
Say, I have an class named Task, it contains a class method do:
@interface Task: NSObject
+ (void) doSomething:(NSString *) value;
@end
The above @interface declaration is in Task.h file. Other objective-c classes are able to call the method without any problem.
My swift code want to call the doSomething method,
Task.doSomething(“do task now!”)
But the above line of code get the following compiler error:
‘Task.Type’ does not have a member named ‘doSomething’.
Why? What is the correct way to call objective-c class method in swift code?
(There are no problems with the generated bridging interfaces between objective-c and swift.)