有參數要傳給 dismiss 的 completion 要怎麼寫?
Pretty easy, pass funcToCall()
as a completion
parameter (important note – I’m using curly braces here):
viewController.dismissViewControllerAnimated(true, completion: {
funcToCall()
})
A completion
parameter documentation:
The block to execute after the view controller is dismissed. This block has no return value and takes no parameters. You may specify nil for this parameter.