【问题标题】:UNNotificationCategory and minimalActions in iOS10iOS10中的UNNotificationCategory和minimalActions
【发布时间】:2017-01-14 04:18:43
【问题描述】:

根据文档UIUserNotificationActionContext 已在iOS 10 上弃用,根据弃用消息我们应该Use UserNotifications Framework's -[UNNotificationCategory actions] or -[UNNotificationCategory minimalActions]

问题是minimalActions 不作为UNNotificationCategory 中的属性存在,根据documentation 和头文件(有趣的是,相关页面记录minimalActions exists 没有被任何链接别的)。那么问题来了,如何在 iOS 10 beta 8 中设置最小操作?我在这里错过了什么?

【问题讨论】:

    标签: notifications ios10 xcode8 swift2.3


    【解决方案1】:

    UNNotificationCategoryminimalActions 属性存在于早期的 beta 版本中,但恐怕它在 Xcode 8 beta 3 中已被删除,这解释了为什么没有任何链接到该 minimalActions 页面了。相反,设置常规的actions 属性,iOS 将根据上下文显示最多四个或前两个。

    【讨论】:

    • 非常感谢您的澄清。不幸的是,在Minimal 上下文中设置actions 属性似乎没有任何效果。唯一显示的操作是默认的“清除”。
    猜你喜欢
    • 1970-01-01
    • 2017-01-19
    • 2017-05-07
    • 1970-01-01
    • 2016-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多