我的UIAlertController调用代码
。我需要将开关添加到警报 View 。
let alertController = UIAlertController(title: "Поздравляем!", message: "Ваш комментарий сохранен! Если хотите изменить его, выключите и включите переключатель Комментария!", preferredStyle: UIAlertControllerStyle.alert)
let okAction = UIAlertAction(title: "Окей", style: .default) { (action) -> Void in
let sb = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "mailVerify")
self.present(sb, animated: true, completion: nil)
}
alertController.addAction(okAction)
self.present(alertController, animated: true, completion: nil)
最佳答案
一种可能的方法是使用 switch 创建自定义 UIView 并以模态方式呈现它而不是 UIAlertController。或者试试这个 Switch in UIAlert Controller programatically
关于ios - 我可以向 UIAlertController 添加开关吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44160798/