【发布时间】:2015-01-25 16:45:28
【问题描述】:
我是 IOS 编程的新手,但我似乎无法从我的故事板将通知打开到特定屏幕。通知看起来像我预期的那样,但我不知道要为点击它分配新行为。
谢谢
编辑:添加代码
// Local notification of event
var localNotification:UILocalNotification = UILocalNotification()
localNotification.alertAction = "Testing notifications on iOS8"
localNotification.alertBody = "You have recieved a new secure communication!"
localNotification.fireDate = NSDate(timeIntervalSinceNow: delay)
localNotification.soundName = UILocalNotificationDefaultSoundName
localNotification.category = "invite"
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
这应该打开到特定的 UI 视图。
【问题讨论】:
-
您需要提供更多详细信息。显示代码。大概您的意思是推送或本地通知,而不是应用内 (
NSNotification) 通知? -
好的,这样可以确认它是本地通知,但是处理接收通知并尝试显示您的视图控制器的代码呢?
-
我不知道该怎么做
标签: ios swift uilocalnotification