mirror of
https://github.com/zhigang1992/ECSlidingViewController.git
synced 2026-03-29 22:38:48 +08:00
44 lines
1.3 KiB
Objective-C
44 lines
1.3 KiB
Objective-C
//
|
|
// FirstTopViewController.m
|
|
// ECSlidingViewController
|
|
//
|
|
// Created by Michael Enriquez on 1/23/12.
|
|
// Copyright (c) 2012 EdgeCase. All rights reserved.
|
|
//
|
|
|
|
#import "FirstTopViewController.h"
|
|
|
|
@implementation FirstTopViewController
|
|
|
|
- (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"];
|
|
}
|
|
|
|
if (![self.slidingViewController.underRightViewController isKindOfClass:[UnderRightViewController class]]) {
|
|
self.slidingViewController.underRightViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"UnderRight"];
|
|
}
|
|
|
|
[self.view addGestureRecognizer:self.slidingViewController.panGesture];
|
|
}
|
|
|
|
- (IBAction)revealMenu:(id)sender
|
|
{
|
|
[self.slidingViewController anchorTopViewTo:ECRight];
|
|
}
|
|
|
|
- (IBAction)revealUnderRight:(id)sender
|
|
{
|
|
[self.slidingViewController anchorTopViewTo:ECLeft];
|
|
}
|
|
|
|
@end |