我正在使用SWRevealViewController
以在我的应用程序中实现侧导航菜单。我想让它在打开后视图时不能与前视图交互,除非当用户点击前视图时,后视图将关闭并且可以再次与前视图交互。我有这两个SWRevealViewController
委托方法,它们当前从前视图中删除了交互。
- (void)revealController:(SWRevealViewController *)revealController willMoveToPosition: (FrontViewPosition)position {
if(position == FrontViewPositionLeft) {
self.view.userInteractionEnabled = YES;
} else {
self.view.userInteractionEnabled = NO;
}
}
- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition: (FrontViewPosition)position {
if(position == FrontViewPositionLeft) {
self.view.userInteractionEnabled = YES;
} else {
self.view.userInteractionEnabled = NO;
}
}
但是,当点击前视图时,这不会导致后视图关闭。任何帮助将不胜感激,谢谢!