Ejemplos de Controlador de Vista de Contenedor [cerrado]


¿Puede alguien señalarme algún buen ejemplo de cómo crear un Controlador de Vista Personalizado como un Controlador de Vista de Contenedor? La única documentación que puedo encontrar es un par de párrafos en la Referencia de la clase UIViewController. Siento que necesito un poco más de información y un ejemplo de implementación sería bueno. Google no ha encontrado nada en absoluto.

Estoy específicamente interesado en el método:

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

7 answers

Lo mejor que he encontrado hasta ahora es la sesión WWDC 2011 Video Sesión 102 - Implementando la contención de UIViewController.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
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/ajaxhispano.com/template/agent.layouts/content.php on line 61
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];
}

Esta IBAction activa la transición entre dos VCs:

-(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/ajaxhispano.com/template/agent.layouts/content.php on line 61
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/ajaxhispano.com/template/agent.layouts/content.php on line 61
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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-10-13 14:56:41

No sé si este es un ejemplo "bueno" , pero puede obtener un contenedor gratuito ViewController desde https://bitbucket.org/javieralonso/jaacordeonviewcontroller/overview

Es un controlador de vista de contenedor de metáfora de acordeón completo

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-11-17 15:42:01

Estos son mis tutoriales / ejemplos favoritos (listos para iOS7) sobre el tema (los tres tienen código fuente disponible en github):

Contención del controlador de vista

Transiciones de Controlador de Vista de Contenedor personalizado

Transiciones de Controlador de Vista de Contenedor Personalizado Interactivo

Y luego, por supuesto, Apple ofrece un artículo completo sobre el tema que encuentro invaluable:

Crear Controladores de Vista de Contenedores Personalizados

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-24 11:32:40