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 6822785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:42:17+00:00 2026-05-26T21:42:17+00:00

The View Programming Guide for iOS tells us that block-based animations are the way

  • 0

The View Programming Guide for iOS tells us that block-based animations are the way forward, as opposed to the now almost deprecated begin/commit style animations:

Note: If you are writing an application for iOS 4 or later, you should use the block-based methods for animating your content instead. For information on how to use those methods, see “Starting Animations Using the Block-Based Methods.”

But now I’m in a situation where I need to use custom timing functions CAMediaTimingFunction so I’ve resorted to using CATransactions and CABasicAnimations. These classes uses the same semantical language as the deprecated UIView animations style with methods like [CATransaction begin] and [CATransaction commit]. It just feels odd in the middle of apps where everything else is block-based.

Is there a way to combine concepts like the CAMediaTimingFunctions with block-based animations?

Update 1:

A piece of example code that I would like to ‘blockify’ looks like this:*

[CATransaction begin];
{    
    [CATransaction setValue:[NSNumber numberWithFloat:3.0f] forKey:kCATransactionAnimationDuration];

    CGPoint low = CGPointMake(0.150, 0.000);
    CGPoint high = CGPointMake(0.500, 0.000);

    [CATransaction begin];
    {
        CAMediaTimingFunction* perfectIn = [CAMediaTimingFunction functionWithControlPoints:low.x :low.y :1.0 - high.x :1.0 - high.y];
        [CATransaction setAnimationTimingFunction: perfectIn];
        CABasicAnimation *fadeIn = [CABasicAnimation animationWithKeyPath:@"opacity"];
        fadeIn.fromValue = [NSNumber numberWithFloat:0];
        fadeIn.toValue = [NSNumber numberWithFloat:1.0];
        [viewB.layer addAnimation:fadeIn forKey:@"animateOpacity"];
    }
    [CATransaction commit];
}
[CATransaction commit];

Update 2

I’ve made an example project for another question of mine that contains the code above. It’s on github.

  • 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-26T21:42:18+00:00Added an answer on May 26, 2026 at 9:42 pm

    But now I’m in a situation where I need to use custom timing functions CAMediaTimingFunction so I’ve resorted to using CATransactions and CABasicAnimations. These classes uses the same semantical language as the deprecated UIView animations style with methods like [CATransaction begin] and [CATransaction commit]. It just feels odd in the middle of apps where everything else is block-based.

    I think you are misreading the documentation.

    Block based animations are the way to do UIView animations. Period. Full stop.

    This statement DOES NOT correspond to CoreAnimation. You still have to use begin/commit for CoreAnimation. Don’t make the assumption that CA begin and commit are bad, just because a higher level construct (UIView) deprecated begin/commit.

    Is there a way to combine concepts like the CAMediaTimingFunctions with block-based animations?

    • If you need the advanced capabilities of Core Anmiation, such as custom timings, you should use CoreAnimation the way it is intended (with begin/commit, etc.)
    • If you are trying to animate CALayers, use Core Animation.
    • If you are doing high-level UIView based animations, use the UIView block-based animations.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read Apple Scroll View Programming Guide for iOS but still confused about
I am working through The BNR Guide to iOS programming, and having some trouble
I was trying to follow the Table View Programming Guide for iPhone OS but
From Apple's View Controller Programming Guide / Managing Memory Efficiently; didReceiveMemoryWarning Use this method
The View controller programming guide states this regarding view controller's usage: Each custom view
I am new to iPhone programming and Objective-C. I am building a View-based application.
Apple has provided an example the View Controller Programming Guide, for creating an UITabBarItem,
In the introduction to iOS Programming: the Big Nerd Ranch Guide , the authors
Having meticulously followed the examples and instructions in the Table View Programming Guide for
According to the View Controller Programming Guide, delegation is the preferred method to dismiss

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.