iphone - Best way to add a UIViewController on top of another UIViewController -


what best way add uiviewcontroller on top of uiviewcontroller present on iphone. there 2 ways know of. there better way? 1 of these better, if not?

1. [self presentmodalviewcontroller:controller animated:no]; 2. [self.view addsubview:somecontroller.view]; 

[[self view] addsubview: [otherviewcontroller view]];  cgrect frame = [[self view] frame];  int direction = 1; switch (direction) {     case 0: // bottom         frame.origin.y = [[self view] frame].size.height;         [[otherviewcontroller view] setframe: frame];         frame.origin.y = 0.0 - [[self view] frame].size.height;         break;     case 1: // right         frame.origin.x = [[self view] frame].size.width;         [[otherviewcontroller view] setframe: frame];         frame.origin.x = 0.0 - [[self view] frame].size.width;         break; }  [uiview animatewithduration: 1.0                       delay: 0.0                     options: uiviewanimationoptioncurveeaseinout                  animations:^{                      [[self view] setframe: frame];                  }                  completion: ^(bool finished) {                   } ]; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -