小编Bra*_*Foo的帖子

如何在swift中声明带参数的块?

很难搞清楚如何使用swift正确声明/使用块.什么是以下代码的快速等价物?

谢谢.

^(PFUser *user, NSError *error) {
if (!user) {
    NSLog(@"Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew) {
    NSLog(@"User signed up and logged in through Facebook!");
} else {
    NSLog(@"User logged in through Facebook!");
}
Run Code Online (Sandbox Code Playgroud)

ios objective-c-blocks swift

12
推荐指数
2
解决办法
3万
查看次数

标签 统计

ios ×1

objective-c-blocks ×1

swift ×1