如何在ios objective c中添加右侧菜单?

如何在ios objective c中添加右侧菜单?,ios,objective-c,xcode9.3,Ios,Objective C,Xcode9.3,我想在项目的右侧添加侧菜单。我现在在我的项目中使用SWRevealViewController第三方类,因为Revealtogle方法在左侧菜单中工作正常,但在右侧添加菜单时,我使用了RightRevealtogle方法,但它工作不正常。任何建议都有助于我完成这项任务 如果要使用目标C中的右侧菜单,请使用 在AppDelegate中: #导入“MFSideMenu.h” 打开和关闭菜单 如果你想使用,那么可以使用下面的代码 设置右视图控制器: @property (strong, nonatom

我想在项目的右侧添加侧菜单。我现在在我的项目中使用SWRevealViewController第三方类,因为Revealtogle方法在左侧菜单中工作正常,但在右侧添加菜单时,我使用了RightRevealtogle方法,但它工作不正常。任何建议都有助于我完成这项任务

如果要使用目标C中的右侧菜单,请使用

在AppDelegate中:

#导入“MFSideMenu.h”

打开和关闭菜单 如果你想使用,那么可以使用下面的代码

设置右视图控制器:

@property (strong, nonatomic) UIViewController *rightViewController;
Animated setting of the front view controller:

- (void)pushFrontViewController:(UIViewController *)frontViewController animated:(BOOL)animated;
Animating the position of the front view controller. Position can be: FrontViewPositionLeftSideMostRemoved, FrontViewPositionLeftSideMost, FrontViewPositionLeftSide, FrontViewPositionLeft, FrontViewPositionRight, FrontViewPositionRightMost or FrontViewPositionRightMostRemoved

- (void)setFrontViewPosition:(FrontViewPosition)frontViewPosition animated:(BOOL)animated;
Creating and obtaining a pan gesture recognizer:

- (UIPanGestureRecognizer*)panGestureRecognizer;
Creating and obtaining a tap gesture recognizer:

- (UITapGestureRecognizer*)tapGestureRecognizer;
Other methods are documented in the SWRevealViewController.h header file.

您使用的是SWRevealViewController,如果您想在右侧实现菜单,只需更改要传递给revealController的ViewController即可

SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
revealController.delegate = self;

revealController.rightViewController = YourViewController;
来自SWRevealViewController的示例

SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
revealController.delegate = self;

revealController.rightViewController = YourViewController;
请在演示中查看RevelControllerProject的AppDelegate.m SWRevealViewController项目


请在这里分享你的代码,这将有助于找到你的问题的解决方案。非常感谢你的代码,它现在正在为我工作。这是我的荣幸:)@CharishmaRao
SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
revealController.delegate = self;

revealController.rightViewController = YourViewController;