Reputation: 31
I have found a code that slide de view and put a ViewController but I don't wanna put a ViewController, the view which I need to add to slide menu is in the same viewcontroller. I need only add this UIView in underleft slide.
OBS.: I'm not using storyboard on this project. I need add an UIView in slidingView
Here is the code thats add the a 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];
}
Upvotes: 1
Views: 252
Reputation: 2818
I think you are using ECSlidingViewController
...
underLeftViewController
is a property and refers to a view controller.
You have to create a new class that inherits from UIViewController and instantiate it. Then you will assign it to underLeftViewController
MyViewController *vc = [[MyViewController alloc] init];
self.slidingViewController.underLeftViewController = vc;
Other way, if you don't want to create a new class you can declare a basic view controller and assign it to underLeftViewController
UIViewController *vc = [[UIViewController alloc] init]
//settings for vc
self.slidingViewController.underLeftViewController = vc;
Upvotes: 1