xcode - Pass method to run on NSURLConnection's connectionDidFinishLoading -



xcode - Pass method to run on NSURLConnection's connectionDidFinishLoading -

i'm creating app phone call api through function:

func servercallapi(function:string, success:((result:nsdictionary) -> void)?) -> void { //code here set request send nsurlconnection allow connection:nsurlconnection = nsurlconnection(request: request, delegate: self, startimmediately: true)! //i want run passed on success function when connectiondidfinishloading called. } i need utilize nsurlconnection update ui when fetching data i might have queue servercallapis waiting in line run, every single own success function. final function needs able that it needs cancel if connection fails. perhaps dispatch or nsoperation? i'm lost on one... :(

my problem cannot think of way phone call passed on success function when connectiondidfinishloading done processing. how can that?

xcode swift nsurlconnection grand-central-dispatch nsoperation

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -