【问题标题】:How to set Viewcontroller before SWRevealViewController如何在 SWRevealViewController 之前设置 Viewcontroller
【发布时间】:2016-07-27 18:05:01
【问题描述】:

我想在我的 V1 和 V2 控制器之前添加 SWRevealViewController。我不知道如何启动reveal-controlle。我添加了我的故事板的屏幕截图,以便大家理解。

【问题讨论】:

  • 您想在 swreaveal 控制器之前添加新的视图控制器吗?
  • 你想要像截图一样的输出吗?
  • 是的,我想要这样
  • 在您的登录屏幕中设置初始视图控制器
  • 在revealvewcontroller.than apply presentview controller中给出故事板标识符

标签: ios objective-c iphone swrevealviewcontroller


【解决方案1】:

首先在任何类中扩展您的 vc3。然后在 vc3 中应用故事板标识符名称。 在vc2中编写代码按钮点击动作方法

vc3 *secondViewController =
    [self.storyboard instantiateViewControllerWithIdentifier:@"storyboardidentifier name"];
[self presentViewController:second animated:YES completion:NULL];

【讨论】:

    【解决方案2】:

    点击此链接

    http://www.appcoda.com/ios-programming-sidebar-navigation-menu/

    照他说的做。在您希望滑出菜单的视图控制器中使用此

        [menuBtn addTarget:self.revealViewController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    

    将显示视图控制器设为您的初始视图控制器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-05
      • 1970-01-01
      • 1970-01-01
      • 2016-06-04
      • 1970-01-01
      • 2015-10-20
      • 2015-04-16
      • 1970-01-01
      相关资源
      最近更新 更多