Search code examples
ioscore-animationios5coverflow

How can I make OpenFlow work correctly in iOS 5.0?


I recently updated my application to use the iOS 5.0 SDK. Within it, I am using Alex Fajowski's OpenFlow cover flow implementation.

I found that when I run the application on iOS 5.0, OpenFlow is making an incorrect transformation or Z repositioning when I swipe through images.

Is there something I can do to make OpenFlow work correctly on the iOS 5.0 SDK?


Solution

  • Today, I finally found the solution for this issue. Apparently, in iOS 5, zPosition is not being animated anymore (too bad, cause the documentation does say so). This is why, this bug may be fixed, by including the correct transition into the CATransform3D.

    Earlier:

        leftTransform = CATransform3DIdentity;
        leftTransform = CATransform3DRotate(leftTransform, SIDE_COVER_ANGLE, 0.0f, 1.0f, 0.0f);
        rightTransform = CATransform3DIdentity;
        rightTransform = CATransform3DRotate(rightTransform, SIDE_COVER_ANGLE, 0.0f, -1.0f, 0.0f);
    

    Now it looks like this:

        leftTransform = CATransform3DTranslate(CATransform3DIdentity, 0, 0, SIDE_COVER_ZPOSITION);
        leftTransform = CATransform3DRotate(leftTransform, SIDE_COVER_ANGLE, 0.0f, 1.0f, 0.0f);
        rightTransform = CATransform3DTranslate(CATransform3DIdentity, 0, 0, SIDE_COVER_ZPOSITION);
        rightTransform = CATransform3DRotate(rightTransform, SIDE_COVER_ANGLE, 0.0f, -1.0f, 0.0f);
    

    Hope it helps you guys, as it did help me.