I'm trying to call an Objective C method with multiple parameters from Swift. I followed the excellent set up instructions here: How do I call Objective-C code from Swift?
My .h header file:
NSMutableData *_responseData;
@interface RegistrationEmailSender : NSObject
- (bool) sendRegistrationEmail;
@end
My function/method declaration:
- (bool)sendRegistrationEmail:( NSString *) un
:( NSString *) em
{
// send email
}
And lastly the call from a Swift class:
// Send User a Validation Email
var sender: RegistrationEmailSender = RegistrationEmailSender()
sender.sendRegistrationEmail(un: username as NSString, em: email as NSString)
I receive this error from XCODE:
Extra argument 'un' in call
I've read around and it seems the "extra argument" error message is misleading and it frequently has to do with type mismatches and other similar causes though I've gone out of my way to ensure the types match. I'm new to Swift and Objective C.