what should go into completion in presentViewController?

ios, iphone

Solution

You can use the below code instead:

[self presentViewController:second animated:YES completion:^{ }];

or you can simply pass NULL

[self presentViewController:second animated:YES completion:NULL];

The completion block is used for doing any tasks after presenting the view controller , the code written inside the completion block will execute only after the view is presented.

Problem

I am using `presentViewController` in xcode and not sure what should go into completion. The code given by xcode documentation: ``` - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion NS_AVAILABLE_IOS(5_0); ``` Example that i am using: ``` [self presentViewController:second animated:YES completion:<#^(void)completion#>]; ``` What should go into completion?

Original source