Objective C blocks and Swift Closure -
I want to convert the following to swift. GOQIIGET: (NSString *) URLString parameter: (id) parameters success: (Zero (^) (ID response object)) Success failure: (Zero (^) (NSError) * Error)) Failure {Return (auto GET: URLString parameter: parameter success: ^ (AFHTTPRequestOperation * Operation, ID response object) {Success (response object); } Failure: ^ (F.httipequast operation * operation, NSERR * error) {Failure (error); }]; }
thanks
I do not include Air Force networking Swift Project ATM, so I can not look at the translated header. You have to check the types, definitely will not match them outside of the code box below. But here's the idea:
func GOQIIGET (urlString: String ?, parameter: AnyObject?, Success: ((responseObject: AnyObject?) -> Zero) ?, Failure: ( (Error: NSError?) -> Zero? -> gt; AFHTTPRequestOperation? {Return Self GET (urlString, Criteria: Criteria, Success: {(Operation: FHTPPartect Operation ?, Answer: Object: Observed?) Success {success (reaction object: reaction object)}}, failure: {(operation: fttttequest operation ?, error: a Siarar ??) If the failure = failure {failure (error: error)}}}}
Comments
Post a Comment