I create two function with ObjectiveC, like:
- (void)showName:(NSString *)name, ...;
- (void)showTitle:(NSString *)title;
I can call showTitle: in my swift code, but can't compile if call showName:
Here is my code:
//Objective_C code:
@interface DemoObject : NSObject
- (void)showName:(NSString *)name, ...;
- (void)showTitle:(NSString *)title;
@end
@implementation DemoObject
- (void)showName:(NSString *)name, ... {
NSLog(@"name=%@", name);
}
- (void)showTitle:(NSString *)title {
[self showName:title, @""];
}
@end
//Swift Code:
var obj = DemoObject()
obj.showTitle("");
obj.showName(""); //compile error here
How to fix this problem. Because I use a third library, it contains Variable parameters functions.