I added animation to push one controller to another controller.here is my code to push view.this animation is taking 2 second in iPhone 5S and taking 5 seconds in iPhone 5.i am not able to figure out what is exact issue.i want this animation for 1 second.here is my code.
DetailVC *detailObj = [[DetailVC alloc] initWithNibName:@"DetailVC" bundle:nil];
detailObj.dataGift = data;
detailObj.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 2.0, 2.0);
[UIView animateWithDuration:1.0
animations:^{
CATransition* transition = [CATransition animation];
transition.duration = 0.75;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.type = kCATransitionFade;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:detailObj animated:false];
detailObj.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.0, 1.0);
} completion:^(BOOL finished) {
}];
});
You are performing animation inside animation block so your duration is increased
Replace your code with
And make sure you perform that in Main Queue
Hope it is helpful