This is a class method and I am passing block as one of the argument So basically how pass blocks in swift?
+ (NSURLSessionDataTask *)getAllSongIfo:(NSDictionary *)userInfo withBlock:(void (^)(NSArray *songInfos, NSError *error))block;
Swift equivalent:
func getAllSongIfo(userInfo: NSDictionary, withBlock block:((NSArray?, NSError?) -> Void)) -> NSURLSessionDataTask
If you want a class method you need to add the class
keyword like:
class func getAllSongIfo(userInfo: NSDictionary, withBlock block:((NSArray?, NSError?) -> Void)) -> NSURLSessionDataTask