Przykłady Container View Controller [zamknięty]

Czy ktoś może wskazać mi jakieś dobre przykłady tworzenia niestandardowego kontrolera widoku jako kontrolera widoku kontenera? Jedyną dokumentacją, którą mogę znaleźć, jest kilka akapitów w UIViewController Class Reference . Czuję, że potrzebuję trochę więcej informacji niż to i przykładowe wdrożenie byłoby miłe. Google nic nie znalazło.

Jestem szczególnie zainteresowany metodą:

transitionFromViewController:toViewController:duration:options:animations:completion:
Author: Bartłomiej Semańczyk, 2011-10-13

7 answers

Najlepszą rzeczą jaką do tej pory znalazłem jest wideo sesji WWDC 2011 sesja 102 - Implementing UIViewController Containment.

 51
Author: hypercrypt,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-02-18 15:40:02
 37
Author: JosephH,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-07-22 15:57:07
- (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];
}

Ta akcja wyzwala przejście między dwoma VC:

-(IBAction)button:(id)sender {
    [self transitionFromViewController:vc1 
                      toViewController:vc2 
                              duration:0.5    
                               options:UIViewAnimationOptionTransitionCurlDown 
                            animations:nil 
                            completion:nil];
}
 17
Author: sonnywang,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-10-10 10:01:22
 11
Author: Yuri Solodkin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-04-10 10:28:52
 10
Author: Peres,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-10-13 14:56:41

Nie wiem, czy jest to" dobry " przykład, ale możesz pobrać darmowy Container ViewController z https://bitbucket.org/javieralonso/jaacordeonviewcontroller/overview

To pełny kontroler widoku kontenera akordeonu

 8
Author: javieralog,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-11-17 15:42:01

Oto Mój ulubiony (gotowy do iOS7) tutorial / przykłady na ten temat (wszystkie trzy mają kod źródłowy dostępny na GitHubie):

Kontroler Widoku

Niestandardowe Przejścia Kontrolera Widoku Kontenera

Interactive Custom Container View Controller Transitions

No i oczywiście Apple oferuje cały wpis na ten temat, który uważam za nieoceniony:

Tworzenie Własnych Kontrolerów Widoku Kontenera

 3
Author: radiovisual,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-09-24 11:32:40