I'm writing an iOS app in the latest version of Swift where, among other things, I need to dismiss a view controller when certain things happen. For that I have the code
self.dismiss(animated: true) {
// Completion logic goes here
}
I've tried it on several iOS devices and various simulators. It works fine in iOS 13.x, but for iOS 12.1 the body of the completion handler is never reached. Why exactly is that? My target, if that matters, is iOS 12.4, but changing it hasn't helped.