objective c - How to translate this objc block to Swift closure? -


objective-c:

    [bmobuser signorlogininbackgroundwithmobilephonenumber:mobilephonenumber andsmscode:smscode block:^(bmobuser *user, nserror *error) {         .........      }]; 

and wrote in swift:

    bmobuser.signorlogininbackgroundwithmobilephonenumber(phonenumber, andsmscode: smscode, block: {(_user: bmobuser, error: nserror) -> () in         ........     }) 

but compiler warning saying "cannot invoke ... argument list of type ..."

so correct syntax of closure in swift? thanks


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -