Please can anybody tell me how to call "attemptLogin" login function defined in objective c class from swift
#import <Foundation/Foundation.h>
@interface LoginHandler : NSObject<NSURLConnectionDelegate,NSXMLParserDelegate>{
}
typedef void (^CustomCallback)(NSDictionary *responseObj);
-(void)attemptLogin:(NSString *)userName andPassword:(NSString *)password completionHandler:(CustomCallback) callback;
@end
, i m calling in swift file like
var loginHandler = LoginHandler();
loginHandler.attemptLogin(userMob, andPassword: userPass){
data in
}
but data
is returned in NSObject form, but it should be NSDictionary
Suppose you have block in Objective C -
Below code will be when you call from swift -