I am building an objective C framework for a swift app. I am trying to use a function in swift by an objective C header file that is imported.
interface MyApi : NSObject
+ (void)init:(NSDictionary *)launchOptions;
@end
@implementation MyApi
+ (void)init:(NSDictionary *)launchOptions {
...
}
@end
These are the .h and .m files in obj C. In swift I am trying to call the function like this:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MyApi.init(launchOptions)
return true
}
But I keep getting the error: Argument passed to call that takes no arguments
at the line I am calling the function. Any thoughts?