How to programmatically dismiss UIAlertController without any buttons?

前端 未结 5 1533
[愿得一人]
[愿得一人] 2020-12-09 07:52

I\'m presenting an UIAlertViewController without any buttons, as it is supposed to just inform users that uploading is in progress. The app is supposed to upload some files

5条回答
  •  死守一世寂寞
    2020-12-09 08:27

    Generally the parent view controller is responsible for dismissing the modally presented view controller (your popup). In Objective-C you would do something like this in the parent view controller:

    [self dismissViewControllerAnimated:YES completion:nil];
    

    The same code in Swift versions < 3 would be:

    self.dismissViewControllerAnimated(true, completion: nil)
    

    Swift 3.0:

    self.dismiss(animated: true, completion: nil)
    

提交回复
热议问题