Programming

컨테이너보기 컨트롤러 예

procodes 2020. 8. 28. 19:15
반응형

컨테이너보기 컨트롤러 예


컨테이너 뷰 컨트롤러로 사용자 지정 뷰 컨트롤러를 만드는 좋은 예를 누구든지 알려줄 수 있습니까? 내가 찾을 수있는 유일한 문서는

UIViewController Class Reference

에있는 몇 개의 단락입니다 . 그것보다 조금 더 많은 정보가 필요하다고 생각하고 예제 구현이 좋을 것입니다. 구글은 아무것도 발견하지 못했다.나는 특히 방법에 관심이 있습니다.

transitionFromViewController:toViewController:duration:options:animations:completion:

내가 지금까지 찾은 가장 좋은 것은 WWDC 2011 세션 비디오

세션 102-UIViewController Containment 구현

입니다.


WWDC 세션 비디오

세션 102-

하이퍼 크립트가 이미 언급 한 UIViewController 포함 구현 외에도

"iOS에서보기 컨트롤러의 진화"에 대한 Apple WWDC 2012 세션

도이 주제를 다루며 예제 코드는 샘플 코드 패키지의 일부입니다.

https://developer.apple.com/devcenter/download.action?path=/wwdc_2012/wwdc_2012_sample_code/wwdc_2012_session_code.dmg

여기에 예제도 있습니다 :

https://github.com/toolmanGitHub/stackedViewControllers


- (void)viewDidLoad{
    [super viewDidLoad];

    // I put self in a Navigation VC so we can use its right navigationbar 
    // item for triggering the transition
    self.navigationItem.rightBarButtonItem = 
     [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit 
                                                    target:self 
                                                    action:@selector(button:)] 
                                                                  autorelease];

    // create test1 and test2 instance (subclass UIViewController and 
    // also need to define their own nibs)
    vc1 = [[test1 alloc]initWithNibName:@"test1" bundle:nil];
    vc2 = [[test2 alloc]initWithNibName:@"test2" bundle:nil];

    //add to the container vc which is self    
    [self addChildViewController:vc1];
    [self addChildViewController:vc2];

    //the entry view (will be removed from it superview later by the api)
    [self.view addSubview:vc1.view];
}

이 IBAction은 두 VC 간의 전환을 트리거합니다.

-(IBAction)button:(id)sender {
    [self transitionFromViewController:vc1 
                      toViewController:vc2 
                              duration:0.5    
                               options:UIViewAnimationOptionTransitionCurlDown 
                            animations:nil 
                            completion:nil];
}

이 예제는 나에게 매우 유용하다는 것을 알았습니다.

http://sandmoose.com/post/35714028270/storyboards-with-custom-container-view-controllers

그리고 그들은 github에 소스가 있습니다.

https://github.com/mluton/EmbeddedSwapping


이것은 :

http://subjective-objective-c.blogspot.com/2011/08/writing-high-quality-view-controller.html

당신의 필요에 충분합니까?


이것이 "좋은"예인지는 모르지만 https://bitbucket.org/javieralonso/jaacordeonviewcontroller/overview 에서 무료 Container ViewController를 얻을 수 있습니다.전체 아코디언 은유 컨테이너 뷰 컨트롤러입니다.


이 주제에 대해 제가 가장 좋아하는 (iOS7 지원) 튜토리얼 / 예제입니다 (3 개 모두 github에서 사용할 수있는 소스 코드가 있음).

컨트롤러 격리보기

사용자 지정 컨테이너보기 컨트롤러 전환

대화 형 사용자 지정 컨테이너보기 컨트롤러 전환

그리고 물론 애플은 내가 중요하다고 생각하는 주제에 대한 전체 글을 제공합니다.

사용자 지정 컨테이너보기 컨트롤러 만들기

참고 URL :

https://stackoverflow.com/questions/7755498/container-view-controller-examples

반응형