Sunday, 15 August 2010

syntax - What are these method parameters called in Swift? -



syntax - What are these method parameters called in Swift? -

i'm taking first steps swift , after having worked things php, ruby, javascript , python, totally new me.

so, have code this:

class derpcontroller: nsurlconnectiondelegate, nsurlconnectiondatadelegate { func connection(connection: nsurlconnection!, didreceiveresponse response: nsurlresponse) { println("response received") } func connection(connection: nsurlconnection!, didreceivedata data: nsdata!) { println("data received") } func connectiondidfinishloading(connection: nsurlconnection!) { println("request finished") } }

what these things called: didreceiveresponse, didreceivedata? kind kind of message identifier or what?

and func connection 1 overloaded method or there 2 identified these "didreceive..." names?

didreceiveresponse external parameter name. response , data local parameter names.

this means first function called myderpcontroller.connection(url, didreceiveresponse:response). within body of function refer parameter response.

the sec function typo, , should didreceivedata

methods syntax swift

No comments:

Post a Comment