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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:36:13+00:00 2026-06-12T16:36:13+00:00

I have a UIImageView with an array of images it iterates through to form

  • 0

I have a UIImageView with an array of images it iterates through to form an animation.

[imageView setAnimationImages:arrayOfImages];

I now need to move this image view along a path whilst it is animating. I had a look through the source code of this example. It uses UIBezierPath to create the path and CALayer to represent the object that moves along the path. But how would I do this for a animating UIImageView?

Many thanks for any advice.

  • 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-06-12T16:36:14+00:00Added an answer on June 12, 2026 at 4:36 pm

    [EDIT] Please note I also had to add the UIImageView as a subview to the current view.

    Finally figured it out using the example I gave before. Here are my steps:

    1. Create the path. (note P = CGPointMake in the code below)

      UIBezierPath *trackPath = [UIBezierPath bezierPath];
      [trackPath moveToPoint:P(160, 25)];
      [trackPath addCurveToPoint:P(300, 120)
               controlPoint1:P(320, 0)
               controlPoint2:P(300, 80)];
      [trackPath addCurveToPoint:P(80, 380)
               controlPoint1:P(300, 200)
               controlPoint2:P(200, 480)];
      

      ….

    2. Create the UIImageView and give it an array of animation images.

      UIImageView *test = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
      [test setAnimationImages:[NSArray arrayWithObjects:[UIImage imageNamed:@"bee-1"],    
      [UIImage imageNamed:@"bee-2"], nil]];
      [test startAnimating];
      
    3. Set the UIImageView’s layer position and add the layer to the view’s layer:

      [test.layer setPosition:P(160,25)];
      [self.view.layer addSublayer:test.layer];
      
    4. Create the CAKeyframeAnimation:

      CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
      anim.path = trackPath.CGPath;
      anim.rotationMode = kCAAnimationRotateAuto;
      anim.repeatCount = HUGE_VALF;
      anim.duration = 8.0;
      [test.layer addAnimation:anim forKey:@"race"];
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of images loaded into a UIImageView that I am animating
I have an array of images (can be up to 25) that need to
I have array of image url. I want to show the images into UIImageView.
I'm kind of stuck with this problem. I have a UIImageView animation with 37
I have 5 images in array which are displaying in UIimageview and displaying one
I have a animation (an array of images) that I put in viewDidLoad because
I have a UIImageView object that when clicked it will play a animation, I
I have an UIImageView and taking the raw touch input. I need to check
I have a UIImageView that is displaying a series of pictures as an animation.
We can specify images array for a UIImageview , and it will animate the

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.