Reputation: 4355
so what I want is to do the same thing Clear (http://www.realmacsoftware.com/clear/) does. If I pan up or down it makes a new rectangle appear with a 3D visual effect.
I did manage to do this by using a translation and rotation transform along with changing the m34
property.
The problem is that since I move 2 views (like Clear moving the rectangle that is showing on screen, and the rectangle appearing with the 3D visual effect), when the user stop touching the screen I use a
[UIView animateWithDuration:0.5
delay:0
options: UIViewAnimationCurveEaseOut
animations:^{
...
}
completion:nil];
to restore the views to a consistent state, either showing the new rectangle, or not (sliding it down), I can see the black background between the 2 views, meaning that the 2 rectangles are not being redrawn at same time. How do I solve that?
Upvotes: 0
Views: 640
Reputation: 1751
It's difficult to answer your specific question without more details, but you can look at https://github.com/mpospese/MPFoldTransition for inspiration.
Mark Pospesel developed this wrapper to perform these kinds of folding transforms, and describes the process behind them in detail in his "Anatomy of a folding animation" blog post.
Upvotes: 3