ios 中block 中传block参数

- (void)registerHandler:(NSString *)name handler:(void (^)(id data,void(^response)(id data)))handler;

 

 

 

调用

 handler(data, ^(id resp){

                    @strongify(self);

                    [self jsResponse:@{@"data" : resp ?: [NSNull null]}

                          callbackId:callbackId];

                });

 

传参数

 [bridge registerHandler:CoinsGoRules handler:^(id data, TXWJCallback response) {

        

        response(@"asdf");

        NSString *scheme = [FDUrlManager FDH5Url];

        NSString *language = [LanguageManager manager].currentLanguage.code;

        NSString *statusBarH = @"20";

        if ([UIDevice isIphone_x_Series]) statusBarH = @"44";

        NSString *urlStr = [[NSString stringWithFormat:@"%@/help/243?lang=%@&", scheme,language] appendDefaultParams];

        

        ADWebViewController *webVC = [[ADWebViewController alloc] initWithCompleteURL:urlStr title:NSLocalizedStringFromTable(@"app_coins_rules", @"Account", nil)];

        [self.navigationController pushViewController:webVC animated:YES];

    }];

你可能感兴趣的:(iOS上架)