Dear Core Animation / iOS experts,
I am trying to get an effect similar to the question below.
Basic animation, layer animation for horizontal movement
The accepted answer seems to accurately describe what I need, except for the code with this answer, and I cannot get the code that I write to work.
Here is what I am trying to do:
1) Have 1 controller / view of the main controller and on the main view part there are 2 UIViews that overlap, only one is shown (1 on the "front" and 1 on the "back")
2) A separate UIControl / UIButton is pressed, and then there is a transition of the 3D transition, which rotates the front (visible) view out of sight and at the same time rotates the back (hidden) front view ... just like seeing a reverse playing card.
3) Hold down the UIControl button to switch between the two viewing modes 4) Only be able to interact with the controls on the front panel (i.e., pressing the front layer will not inadvertently work on the rear panel, which is located under the tap)
Perhaps I am approaching this wrong, so let me know. Ideally, I would like to use Core Animation rather than the UIView built into the flip transaction, as I want the animation to be 3D, and also want to use this task as a step to create more complex CA material.
At the moment, I can get a front view to switch well (only once), but the rear view is not displayed.
Cheers
Andy
Here is the code I have:
MainViewController.h
@interface MainViewController : UIViewController - (IBAction)changeViewTapped:(UITapGestureRecognizer *)recognizer; @end
MainViewController.m
source share