How do I declare NULL / Void fast when I don't need to use a completion block?

Here is the code in objective-c:

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

      

My code is fast so far:

self.presentViewController(logInViewController, animated: true, completion:  )

      

Thought it would be as easy as typing Void. Unfortunately, there is a little more.

+3


source to share


1 answer


Apple's documentation on advance notice states:

func presentViewController(_ viewControllerToPresent: UIViewController!,
                                       animated flag: Bool,
                               completion completion: (() -> Void)!)

      

Parameters

viewControllerToPresent

      

The view controller displays the contents of the current controller.

flag

      



Pass true to animate the presentation; otherwise, pass false.

completion

      

The block to execute after the presentation ends. This block has no return value and takes no parameters. You can specify nil for this parameter.

Therefore, you can specify nil

for this parameter.

You can access this preliminary documentation from your iOS Dev Center

+4


source







All Articles