如何在显示&#34之前显示带有(多选列表视图)的对话框;应用程序希望向您发送推送通知"对话框

时间:2016-03-30 06:21:51

标签: ios apple-push-notifications uialertview

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

我认为我必须在UIAlertView中显示一个tableview,但它现在已被弃用。那么,如何在 Swift 中的APN系统权限对话框之前显示一个pop(带有一些小消息+多个选择列表)。

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

您可以使用此代码:

    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. 
}