ios - 如何在显示 "app would like to send you push notifications"对话框之前使用(多选 ListView )显示对话框

标签 ios apple-push-notifications uialertview

我想显示一个弹出窗口,我会在其中询问用户他们与推送通知相关的偏好,对于那个,我想向用户显示一个选项列表。用户可以选择多个选项。

我认为我必须在 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/

相关文章:

ios - 用户按下了 UIAlertView 上的哪个按钮?

iphone - 如何创建一个乐器

ios - 无法从 iOS 发送 facebook apprequest,因为 FBSession.activeSession.isOpen 给出 false

ios - 如何在 NSUserDefaults 中存储自定义对象

ios - 初始创建后无法下载 Apple Developer key

ios - 如何向 ios 警报添加操作

ios - 仅在纵向获取屏幕宽度和高度

ios - 如何在Apple Watch上启用通知?

ios - 如何处理 iOS 中的未读推送通知?

ios - 使按钮成为 UIAlertView 执行 Segue