Is there a way to place a completion handler in the parent UIViewController that gets called after its child UIViewController dismisses itself?
For my current project a UIViewController might have to create and present a child UIViewController to get missing data.
My thought was that the completion handler in the present method wouldn't be called till the child UIViewController dismisses itself.
Obviously I was wrong, the completion handler is called immediately after the child UIViewController is presented, yet still exists.
This is an extremely simplified code, just so I can see when the completion handler is being called within the debugger.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
...determine if data is missing...
if *data is missing* {
let myUp = UploadInv()
myUpload.modalPresentationStyle = .fullScreen
myUpload.modalTransitionStyle = .flipHorizontal
x += 1
self.present(myUpload, animated: true, completion: { [self] in print ("\(x)");})
}}