我有一个警报视图,当用户按下注销按钮时,他们可以选择注销或取消,但是如果我离开应用程序并返回(不杀死应用程序),警报视图处于活动状态,警报视图消失但我希望它仍然处于活动状态,因为用户尚未选择取消或注销。有没有办法做到这一点?谢谢
好吧,我认为在这种情况下不需要放置我的代码,无论如何这就是我的函数的样子
func displayLogOutAlert() {
let alert = PCLBlurEffectAlert.Controller(title: nil, message: nil, effect: UIBlurEffect(style: .light), style: .actionSheet)
let alertBtnYes = PCLBlurEffectAlert.Action(title: "Log Out", style: .destructive, handler: { (action) in
alert.dismiss(animated: true, completion: nil)
FBSDKLoginManager().logOut()
GIDSignIn.sharedInstance().signOut()
self.logoutIndicator.startAnimating()
self.performSegue(withIdentifier: "backToLogin", sender: self)
})
let alertBtnCancel = PCLBlurEffectAlert.Action(title: "Cancel", style: .cancel, handler: nil)
//self.presentingViewController?.dismiss(animated: true, completion: nil)
alert.addAction(alertBtnYes)
alert.addAction(alertBtnCancel)
//setting button/text properties
alert.configure(cornerRadius: 10)
alert.configure(buttonBackgroundColor: UIColor.white)
alert.configure(buttonHeight: 55)
alert.configure(buttonFont: [.destructive: UIFont.systemFont(ofSize: 20), .cancel: UIFont.boldSystemFont(ofSize: 20)])
alert.show()
}