【发布时间】:2019-01-08 15:38:19
【问题描述】:
我正在使用通知内容扩展。在 extensionViewController 中,有两个按钮用于不同的操作,第一个按钮移动到 firstViewController(FirstVC),第二个按钮移动到 secondViewController(SecondVC)。 我为此使用故事板 ID,然后它也显示错误(使用未声明的类型 FirstVC)。
let vc = self.storyboard?.instantiateViewController(withIdentifier: "first") as! FirstVC
self.present(vc, animated: true, completion: nil)
如果有任何解决方案,请指导我。谢谢。
【问题讨论】:
-
请附上您的代码
-
让 vc = self.storyboard?.instantiateViewController(withIdentifier: "first") as! FirstVC self.present(vc, animated: true, completion: nil)
-
这个FirstVC在哪里??您应该转换为您的 viewController 名称而不是 UIviewController。
-
请再次查看我的评论。
-
不要在 cmets 中发布代码,而是更新您的问题。
标签: ios iphone swift xcode push-notification