【发布时间】:2015-12-12 06:11:18
【问题描述】:
我正在使用SWRevealViewController。我的frontViewController 显示应用程序的各种不同内容,rearViewController 显示一个表格,其中包含指向这些选项的链接。因此,如果我的 frontViewController 当前正在显示主页,我希望 rearViewController 菜单表突出显示该行,以此类推其他每个选项。为此,菜单或rearViewController 需要知道frontViewController 正在显示哪个视图。我尝试在frontViewController 显示的每个ViewControllers 上设置restorationIdentifier,然后在menuViewcontroller 中访问它们,但每次它们返回nil。
所以我在menuViewControllers viewDidLoad 方法中做了这样的事情
self.revealViewController.frontViewController.restorationIdentifier
我还在 VC 视图上设置了 restoreIdentifiers 并尝试了这个:
self.revealViewController.frontViewController.view.restorationIdentifier
但这也返回了 null
【问题讨论】:
标签: ios uiviewcontroller swrevealviewcontroller