小编Jeg*_*g0g的帖子

UIUserNotificationSettings拒绝接受swift中的多种通知类型

我想迅速发送通知.这是我在注册通知的appdelegate.swift文件中的代码

application.registerUserNotificationSettings(
    UIUserNotificationSettings(
        forTypes:UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, categories: nil))
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

二元运算符'|' 两个'UIUserNotificationType'操作数.

如果你能帮助我找到解决这个问题的解决方案,那就太好了.

谢谢

notifications ios swift xcode7

4
推荐指数
1
解决办法
7113
查看次数

标签 统计

ios ×1

notifications ×1

swift ×1

xcode7 ×1