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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:02:36+00:00 2026-05-23T15:02:36+00:00

Currently, I figured out how to animate an image that is in my UIViewController:

  • 0

Currently, I figured out how to animate an image that is in my UIViewController:

    UIImage *image = [UIImage imageNamed:@"Logo.png"];

    CALayer *logoLayer = [CALayer layer];
    logoLayer.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
    logoLayer.position = CGPointMake(300, 216);
    logoLayer.contents = (id)image.CGImage;
    CAKeyframeAnimation *moveAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
    moveAnimation.path = path.CGPath;
    moveAnimation.duration = 2.0f;
    [logoLayer addAnimation:moveAnimation forKey:@"moveAnimation"]; 

    CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
    animationGroup.duration = 2.0f;
    animationGroup.autoreverses = NO;
    animationGroup.repeatCount = 1; //HUGE_VALF
    [animationGroup setAnimations:[NSArray arrayWithObjects: moveAnimation, nil]];

    [logoLayer addAnimation:animationGroup forKey:@"animationGroup"];

But this is based on a logoLayer, which is an image. How could I animate something like this but for a UIView? Such as a UIButton?

  • 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-23T15:02:37+00:00Added an answer on May 23, 2026 at 3:02 pm

    In general, rather than using CAAnimations on CALayers, you can use UIView animation. There are ways to set animation curve, delay, repeat, reversal, and so on using the block-based animation API or the old delegate-based API.

    As for your specific case of the CAKeyframeAnimation, you can try the answer to this question.

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

Sidebar

Related Questions

I am currently trying to figure out KendoUI. I am using version 2012.1.322. I
I'm currently struggling to figure out a solution to a situation I'm in. I'll
I am currently trying to figure out how you can bind multiple fields in
I am currently re-writing an existing tool in PHP that another person started for
I looked up WCF and i cant exactly figured out what it is. I
I modified a simple image slider in jsfiddle and can't figure out why I
I'm currently working on a website that you'll find here: http://steadfastdesignfirm.com/rgw/ . I used
I've been trying to figure out a decent way to smoothly animate a frame
I'm trying to figure out how to animate the change from Visibile to Hidden
I want to mask out part of an image on a page, making part

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.