2013-08-28 2 views
1

뷰를 슬라이드하고 ViewController를 넣는 코드를 찾았지만 ViewController를 넣고 싶지 않습니다. 슬라이드 메뉴에 추가해야하는 뷰는 동일한 viewcontroller에 있습니다. 이 UIView를 밑줄 친 슬라이드에만 추가하면됩니다.페이 스북 응용 프로그램으로 슬라이드 메뉴

OBS :이 프로젝트에서는 스토리 보드를 사용하지 않습니다.

underLeftViewController

가 재산이며보기에 의미 ...

- (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]; 
} 

답변

1

난 당신이 ECSlidingViewController를 사용하여 생각 : 나는 코드 그게이 (가)의 ViewController를 추가 할 것입니다 여기에

slidingView

에있는 UIView를 추가 필요 제어 장치.

UIViewController에서 상속받은 새 클래스를 만들어 인스턴스화해야합니다. 당신이 기본 뷰 컨트롤러를 선언하고 underLeftViewController

UIViewController *vc = [[UIViewController alloc] init] 
//settings for vc 
self.slidingViewController.underLeftViewController = vc; 
에 할당 할 수있는 새로운 클래스를 생성하지 않으려면 그런 다음, underLeftViewController

MyViewController *vc = [[MyViewController alloc] init]; 
self.slidingViewController.underLeftViewController = vc; 

다른 방법에 할당됩니다

관련 문제