码迷,mamicode.com
首页 > 移动开发 > 详细

转 How to correctly set application badge value in iOS 8?

时间:2014-09-15 15:31:19      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:style   io   os   ar   for   div   art   sp   on   

o modify the badge under ios8 you have to ask for permissions

    let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Badge, categories: nil)
    UIApplication.sharedApplication().registerUserNotificationSettings(settings)

or in objC

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];

转 How to correctly set application badge value in iOS 8?

标签:style   io   os   ar   for   div   art   sp   on   

原文地址:http://www.cnblogs.com/liangjialun219/p/3972832.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!