我正在 iOS 中实现登录。我想先放松到之前的 VC(IntroVC),并显示已完成的注册提醒关于 IntroVC 已完成。
(completingSignUp 是 Unwind 函数。)
@IBAction func completingSignUp(_ segue: UIStoryboardSegue) {
let completedAlert = UIAlertController(title: "Completing", message: "Congratulations.", preferredStyle: .alert)
let ok = UIAlertAction(title: "OK", style: .default, handler: nil)
completedAlert.addAction(ok)
self.present(completedAlert, animated: true)
}
它只显示警报,不展开到 IntroVC。
我认为警报代码的位置似乎不正确。
告警代码应该写在哪里?
最佳答案
将代码放入IntroVC的viewDidAppear
。您将需要引入一个条件,以便仅当您通过 unwind segue 返回时才显示警报。
关于ios - 如何在 iOS 中展开过渡后显示警报?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52893162/