this class method , passing block 1 of argument 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 want class method need add class keyword like:
class func getallsongifo(userinfo: nsdictionary, withblock block:((nsarray?, nserror?) -> void)) -> nsurlsessiondatatask
Comments
Post a Comment