jeudi 5 mars 2015

Removing Subview after the completion of Animation - Transition - iPhone/iPad

On a button click, I have placed a TRANSPARENT View on the current View. For the transparent view to cover the entire screen including navigation bar, I have coded like this :



[AppDelegate.window.rootViewController.view addSubview:coverView];


In the button click action,I have put some animation code.


Now, on a button click in Transparent View, I have put the following code to perform a sliding transition effect:



CATransition *animation = [CATransition animation];
[animation setDuration:0.8];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromLeft];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[TransparentView.view layer] addAnimation:animation forKey:nil];
[TransparentView removefromSuperview];


I need the transparent view to slide towards left/right (in other words..removing TransparentView from view) and MainView should appear as before.


But its not working.. Could anyone help on this ?




Aucun commentaire:

Enregistrer un commentaire