iOS blockCallBack参数也是block的情况

2021-01-22  本文已影响0人  阿拉斯加的狗

blockCallBack参数也是block的情况

    self.themeSettingView.goToOneClickLoginCallBack = ^(void (^ _Nonnull callback)(BOOL)) {
        [[CYOneClickLoginManager sharedManager] oneClickLoginWithVC:weakSelf loginDelegate:nil isMustBindPhone:YES loginCallBack:^(CYUser * _Nonnull user) {
            if (callback) {
                callback(YES);
            }
        }];
    };

实现

@property (nonatomic, copy) void (^goToOneClickLoginCallBack)(void (^)(BOOL));
            if (weakSelf.goToOneClickLoginCallBack) {
                weakSelf.goToOneClickLoginCallBack(^(BOOL isLogin) {
                    if (isLogin) {
                        CYThemeSettingModel *model = weakSelf.themeArray[indexPath.row];
                        [weakSelf clickThemeWithThemeModel:model];
                    }
                });
            } 
上一篇下一篇

猜你喜欢

热点阅读