ios - Difference between transitionfromview and addsubview -


is transitionfromview:toview:duration:options:completion: similar [self.view addsubview:secondview];

rootviewcontroller.m

self.svc = [[secondvc alloc]init];      [uiview transitionfromview:self.view toview:self.svc.view duration:1.0 options:uiviewanimationoptiontransitionflipfromleft completion:^(bool finished) {}]; 

is similar

rootviewcontroller.m

        self.svc = [[secondvc alloc]init];      [self.view addsubview:self.svc];  [uiview animatewithduration:0.25                       delay:0                     options:uiviewanimationoptioncurveeaseout............. 

does first approach can lead memory leaks? approach correct?

you should use transitionfromview:toview:duration:options:completion: if switch 1 view , want discard first one. if add additional views view should use addsubview:


Comments