如何在SWIFT中触发UILocalNotification时调用方法?

时间:2016-09-01 08:24:31

标签: objective-c swift uilocalnotification

我有本地通知,需要在通知用户时调用方法。如何实现?

1 个答案:

答案 0 :(得分:0)

我建议您使用this库来更轻松地处理UILocalNotifications。使用此功能,您可以轻松处理所有操作。要回答你的问题,你可以这样做:

LocalNotificationHelper.sharedInstance().registerUserNotificationWithActionButtons(actions: actions)

但你必须在appDelegate内处理它。