I want to dismiss a loader view controller then present an UIDocumentInteractionController
. I found an objective-c solution, but I want the Swift 3 one.
This is the objective-c code taken from this answer:
// Does not break
[viewController1 dismissViewControllerAnimated:YES completion:^{
[self presentViewController:viewController2 animated:YES completion:NULL];
}];
I translated like this in Swift 3:
self.dismiss(animated: false, completion:{
self.docController = UIDocumentInteractionController(url: destinationUrl!)
self.docController!.presentOpenInMenu(from: CGRect.zero, in: self.view, animated: true)
})
It works fine, but I want to be sure that the completion:^{
in objective-c means completion:{
in Swift 3.