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

  • Home
  • SEARCH
  • 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 6926489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:55:29+00:00 2026-05-27T10:55:29+00:00

I am trying to develop transition effect, when one view splits into 2 parts

  • 0

I am trying to develop transition effect, when one view splits into 2 parts with upper part animated upwards and lower part animated downwards to revel the view behind it.
I am using UIView and UIImageView approach to accomplish that:

// 1. Make a screenshot:
    UIGraphicsBeginImageContext(parentView.frame.size);
    [parentView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    // 2. Calculate rectangles for top and bottom part:
    CGRect rectTop, rectBottom;
    CGFloat W = rectBig.size.width;
    CGFloat H = rectBig.size.height;


    rectTop = CGRectMake(0, 0, W, y_cutoff);
    rectBottom = CGRectMake(0, y_cutoff, W, H - y_cutoff);

    // 3. Create top and bottom images:
    CGImageRef imageRefTop      = CGImageCreateWithImageInRect([screenshot CGImage], rectTop);
    CGImageRef imageRefBottom   = CGImageCreateWithImageInRect([screenshot CGImage], rectBottom);


    UIImage *imageTop = [UIImage imageWithCGImage:imageRefTop];
    UIImage *imageBottom = [UIImage imageWithCGImage:imageRefBottom];


// 4. Assign images to image views:
imageViewTop.image = imageTop;
imageViewBottom.image = imageBottom;

// 5. Animate image views:
[UIView beginAnimation:nil context:NULL];
.... animation code here
[UIView commitAnimations];

This code however, is extremely slow on the device and I am sure there is a more efficient way to implement such a transition. Most probably using CALayers, etc..
Can you point me to the right direction?

  • 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-27T10:55:30+00:00Added an answer on May 27, 2026 at 10:55 am

    This is not animation. Your drawing code is slow. If you profile, you will see that renderInContext: (btw. always executed on the main thread) and CGImageCreateWithImageInRect are the limiting factors. What your view (the one you want to split) is about? Is it an option to create two views instead of one from start?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to develop my first ASP.NET MVC web app and have run into
I'm trying to develop a firefox extension that inserts additional HTTP header fields into
I'd been trying to develop one with this for a long time. I'd try
I am trying to develop a package in SSIS 2005 and part of my
I'm trying to develop a shell in Linux as an Operating Systems project. One
Iam trying to develop an iphone app having tab view as the base, within
I am trying to develop an online translation service (sort of a personal challenge)
I am trying develop a basic referrer system to my Django website, system will
I am trying to develop a multimedia site and I am leaning heavily toward
I am trying to develop a .NET Web Project using NHibernate and Spring.NET, but

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.