如何在显示 "app would like to send you push notifications" 对话框之前使用(多选列表视图)显示对话框

How to display a dialog with (multiselect listview) before displaying "app would like to send you push notifications" dialog box

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

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

如有任何帮助,我们将不胜感激。

您可以使用此代码:

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