I wrote a class in a swift file:
class UtilityMethods {
class func userId() -> Integer {
...
}
class func setUserId(userId : Int) {
...
}
}
I am importing the -swift.h header, which compiles fine, but I cannot use
[UtilityMethods userId]
in my Objective-C code:
Unknown receiver 'UtilityMethods'; did you mean 'UtilMethods'?
UtilMethodsis the Objective-C class that I would like to replace. Did I miss something?
EDIT
With Lance, the class is now recognized, but the getter method is not, unfortunately, the header file as follows:
SWIFT_CLASS("_TtC15...14UtilityMethods")
@interface UtilityMethods : NSObject
+ (void)setUserId:(NSInteger)userId;
- (instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
Why is there a missing getter?
source
share