我想显示一个弹出窗口,我会在其中询问用户他们与推送通知相关的偏好,对于那个,我想向用户显示一个选项列表。用户可以选择多个选项。
我认为我必须在 UIAlertView 中显示一个 TableView ,但现在已弃用它。那么,如何在 Swift 中的 APN 系统权限对话框之前显示弹出窗口(带有一些小消息 + 多选列表)。
任何帮助将不胜感激。
最佳答案
您可以使用此代码:
let alert = UIAlertController(title: title, message:message, preferredStyle: .Alert)
let action = UIAlertAction(title: "OK", style: .Default) { _ in
acceptNotification = true //code to execute when the user taps that OK
}
alert.addAction(action)
//you can add more actions
self.presentViewController(alert, animated: true){ // this part if provided, will be invoked after the dismissed controller's viewDidDisappear: callback is invoked.
}
关于ios - 如何在显示 "app would like to send you push notifications"对话框之前使用(多选 ListView )显示对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36301166/