我试图通过一个接一个地生成一个警报来测试我制作的警报生成器,但是我意识到的第二个警报永远不会被呈现,因为之前的警报没有被解雇。如何在第一个警报被解除后立即调用第二个警报。以下是我对警报定义的看法:
let test1: UIAlertController = alertGenerator(title: "test1", message: "test1", actions: settings)
let test2: UIAlertController = alertGenerator(title: "Test2", message: "test2", actions: cancel)
if CLLocationManager.authorizationStatus() == .denied {
print("Authorization Denied")
self.present(test1, animated: true, completion: nil)
}
self.present(test2, animated: true, completion: nil)