Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6245659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:32:45+00:00 2026-05-24T12:32:45+00:00

Using Core Animation, I would like to fold a UIView (i.e. it’s CALayer )

  • 0

Using Core Animation, I would like to fold a UIView (i.e. it’s CALayer) on it’s center. i.e. I would set the anchor point as (0.5,0.5) & fold the layer. This image that I created in Photoshop might give the effect I am looking for –

enter image description here

So, what’s happening is, the layer is being folded on its center, as the fold is happening a little bit of perspective is applied (the infamous m34!). Initially, the view is parallel in X-Y plane with Z axis looking straight to the user. As the fold is happening, bottom half & top half at the same time move back (with some perspective, to give depth & 3D effect) till the entire layer is (parallel) in X-Z plane. Note that once the layer is parallel in X-Z plane, the user will no longer be able to see the Layer. But that’s ok, that’s the effect I am looking for. A UIView disappearing by folding on it’s center.

How would one go about doing this in iOS? Without using 2 different layers (for bottom & for top)? Any help is much appreciated…

Update: As @miamk points out, this is the same UI effect used in “Our Choice” App or “Flipboard” App.

UPDATE: I have offered bounty on this to get more specific answers. Would love to see –

  1. Code samples.
  2. Advise from people who have done something like this.
  3. Even the way to achieve this in a detailed fashion (algo) is much appreciated.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:32:46+00:00Added an answer on May 24, 2026 at 12:32 pm

    A CALayer is a plane, and can not be folded. Unless you write a core image filter for it, like the page curl effect, but that if private API and not an option to you.

    You need to split your view into two views, and fake the fold by transforming the two CALayers simultaneously.

    By default a layers transform do not have perspective, so you must also setup this:

     transform.m34 = 1.0 / -2000;
    

    OK Let’s be even clearer: Split the view in two and fold them:

    Your view hiarchy according to the image you posted looks something like this:

    + UIView      - Root view
        + UIImageView - The persons face
        + UILabel     - The label with title
        + UILabel     - The label with company name
        + UILabel     - The label with a short description.
        + UILabel     - The label with e-mail
        + UILabel     - The label with web address
        + UILabel     - The label with phone number
    

    So introduce two new views to this view hierarchy for the purpose of folding, like this:

    + UIView    - Root view
        + UIView      - Top half of the card
            + UIImageView - The persons face
            + UILabel     - The label with title
            + UILabel     - The label with company name
            + UILabel     - The label with a short description.
        + UIView      - Bottom half of the view
            + UILabel     - The label with e-mail
            + UILabel     - The label with web address
            + UILabel     - The label with phone number
    

    Not too hard. Now animate only the two views used for grouping the top and bottom half.

    I will not write the code for you, but one more vital tip to make it easy: Change the anchor points of the view to animate! You do not want to rotate them by their own centers, instead shift the center of rotation to align with the edges they have against each other.

     topView.layer.anchorPoint = CGPointMake(0.5f, 1.0f);
     bottomView.layer.anchorPoint = CGPointMake(0.5f, 0.0f);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a layer-hosting view set up like this in a custom NSView subclass:
I'm working with some Core Animation for the first time and in the process
I've been using Core Plot to draw some charts for an iOS app I've
I'm in need of particle animation in my UIView -based 2D game. At present
In learning Core Animation, I learned very quickly that if you don't do it
I had an idea for an app that would require me to implement these
How hard would be be to recreate Windows Phone 7 UI animations on an
Started playing around with jQuery and the jsTree plugin yesterday, and have it successfully
i have a have graphview.m which creates a coreplotviewcontroller.view in this way CorePlotViewController *aCorePlotViewController
[I'm going to be interviewed for a position, and I don't want to oversell

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.