在MZFormSheetController中使用didDismissCompletionHandler

问题描述:

我使用MZFormSheetController在我的应用程序中呈现模态。有一种情况是我想在我解雇第一个工作人员后立即提交第二名工作人员。为了做到这一点,有一个completion block,但我不知道如何实际使用它。在MZFormSheetController中使用didDismissCompletionHandler

的代码看起来是这样的:

[self mz_presentFormSheetController:formSheet 
           animated:YES 
         completionHandler:^(MZFormSheetController *formSheetController) { 
          formSheetController.didDismissCompletionHandler; 
         }]; 
在完成处理

,那我应该做的就是通知的薄片解雇,所以我就可以调用第二片?

这实际上非常简单,但如果您没有花费一些时间在这种类型的环境中,则不完全直观。

[self mz_presentFormSheetController:formSheet 
           animated:YES 
         completionHandler:^(MZFormSheetController *formSheetController) { 
          formSheetController.didDismissCompletionHandler = ^(UIViewController *presentedViewController){ 
            [self presentOtherController]; 
          }; 
         }];