【问题标题】:How could I access a SWRevealViewController Table Cell so that I can performSegueWithIdentifier如何访问 SWRevealViewController 表单元格以便我可以执行SegueWithIdentifier
【发布时间】:2016-04-23 16:27:05
【问题描述】:

我有一个 SWRevealViewController 可以打开一个侧边菜单,我通过它在我的 Storyboard 中手动连接了 segue。单击单元格后,我想以编程方式使用 performSegueWithIdentifier ,但我不知道如何访问表格的“单击单元格”方法。有没有人对这个特定的库有经验,可能知道如何做到这一点?

【问题讨论】:

  • 您可以使用作为其中一部分的每个视图控制器的显示控制器属性直接从彼此继承和/或访问每个控制器。类似于 self.revealViewController().rightViewController

标签: ios swift swrevealviewcontroller


【解决方案1】:
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {



    SWRevealViewController *revealController = self.revealViewController;
    revealController.panGestureRecognizer.enabled = NO;
    UIViewController *objViewController = [[UIViewController alloc]initWithNibName:@"UIViewController" bundle:nil];

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:objViewController];
    [revealController pushFrontViewController:navigationController animated:YES];


 }

使用这个

【讨论】:

    猜你喜欢
    • 2020-08-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-30
    • 2023-04-09
    • 2011-10-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多