我找到了滑动视图并放置 ViewController 的代码,但我不想放置 ViewController,我需要添加到幻灯片菜单的视图位于同一个视图控制器中。我只需要在左下幻灯片中添加这个 UIView。
OBS.:我没有在这个项目中使用故事板。我需要在滑动视图中添加一个 UIView
这是添加 ViewController 的代码:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// shadowPath, shadowOffset, and rotation is handled by ECSlidingViewController.
// You just need to set the opacity, radius, and color.
self.view.layer.shadowOpacity = 0.75f;
self.view.layer.shadowRadius = 10.0f;
self.view.layer.shadowColor = [UIColor blackColor].CGColor;
if (![self.slidingViewController.underLeftViewController isKindOfClass:[MenuViewController class]]) {
self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
}
[self.view addGestureRecognizer:self.slidingViewController.panGesture];
}