ios - 处理通知中 View 的点击

标签 ios swift apple-push-notifications

是否可以处理用户触摸通知 View 时的事件? 我需要这个点击像一个 Action 按钮一样,它会从一个详细的地方发送一个 View 。 现在,当用户触摸 View 时,应用仅打开当前 View 。

这是我处理操作按钮的实际代码:

  func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) {

    if identifier == ACTION_ONE_IDENTIFIER {...}

我需要所有 View 都相同。

抱歉我的英语不好,欢迎编辑!谢谢

最佳答案

您需要使用观察者来处理通知。

NSNotificationCenter.defaultCenter().addObserver(self, selector: "", name:"", object: nil)

与 Post Observer 相同,并在到达 viewcontroller 后将其删除。

关于ios - 处理通知中 View 的点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37862549/

相关文章:

ios - 运行时属性和实际属性之间的性能差异是什么?

iOS 将 const char 与 int 连接起来

ios - 成功登录后导航未激活

iOS 7 远程通知

ios - 在 IOS 应用程序的后台接收来自 firebase 的通知?

php - APNs Provider API 批量请求

android - Apple 的 Bonjour 协议(protocol)是否适用于蜂窝连接?

html - iOS - UIWebView 不显示 HTML

ios - undefined symbol :___ isplatformversionatleast

ios - 无法使用 [AnyObject] 类型的参数列表调用“'setViewController'”