I've learned how to write dismiss more simply, which wasn't taught in the introductory book, so I'll describe it here.
python
dismiss(animated: true, completion: nil)
python
dismiss(animated: true)
・ From Apple official document completion: (() -> void)? = nil) As described in, if you do not pass an argument to completion, nil will be passed without writing anything, so you can omit completion.
・ From Apple official document In other words
completion is It is a block for executing processing after the view controller is dismissed, and has no return value or parameter value. Maybe you put nil in this argument.
... apparently ... Lol
completion means completion </ b>, achievement </ b>, so A block of processing that is executed when a method is completed </ b> It seems good to remember.
・ From Apple official document It seems that the processing inside the completion block is executed after viewDidDisappear is called.
Recommended Posts