例如在iOS 10中有UserNotifications
框架。在此之前,你只需要使用:当您在swift中运行弃用代码时会发生什么?
let settings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
(我在iOS 10上运行上面的代码,没有发生任何事情)。
我的一般问题是:会一直运行不推荐的语法崩溃,什么都不做(如现在),或者它如何对待未知?
我要求得到更好的调试了解。
@pjs但事实上,使用UILocalNotification并链接到iOS 10的代码确实不工作。 – matt
@pjs但这与“编译器”无关。 – matt