在解除presentationviewController后显示警告

问题描述 投票:1回答:1

当用户购买completion handler通知我并解雇viewController。但是,我想在alert解雇后向用户显示/显示viewController。在我进入调试器的那一刻,它会通过代码但是没有显示警报。仍然在苹果公司内置All set。有没有办法在解雇viewController后显示我的警报。

override func viewWillDisappear(_ pAnimated: Bool) {
    super.viewWillDisappear(pAnimated)
    self.notifyForUserHasPurchasedProduct {
        self.presentingViewController?.dismiss(animated: true, completion: {
            UIAlertController.bs_showAlertFrom(self, title: "AppName", message: "Thank you. Your purchase was successful")
        })
    }
}
ios swift in-app-purchase uialertcontroller
1个回答
2
投票

你需要打电话给qazxsw poi来显示警报。当qazxsw poi qazxsw poi不存在时,您需要将代码更改为self.present(alert, animated: true)

我已经建立了一些功能:

ViewController

然后像这里一样使用它们:

self
© www.soinside.com 2019 - 2024. All rights reserved.