IPhone : Push animation fades both views at end, How can I display them without faded till animation ends?

on Tuesday, March 31, 2015

I have a push animation like slider but not interactive. Problem is both views get faded at end. Both view should keep displaying till animation ends. I already have check both views, none of them have clearColor. Here's the code which I am trying to do:



- (IBAction)loginButtonTapped:(id)sender
{
LoginViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
dispatch_async(dispatch_get_main_queue(), ^{
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
CATransition *transition = [CATransition animation];
transition.duration = 0.3f;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
transition.fillMode = kCAFillModeBoth;
CAMediaTimingFunction *timeFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.timingFunction = timeFunction;
transition.removedOnCompletion = YES;
[self.navigationController.view.layer addAnimation:transition forKey:@"someAnimation"];

[self.navigationController pushViewController:viewController animated:NO];
[CATransaction commit];
});


}


It results into following animation:Cant upload the image Dropbox link https://www.dropbox.com/s/k6w7k8p520w8yrx/PushAnimation.gif?dl=0


0 comments:

Post a Comment