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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:11:05+00:00 2026-06-10T04:11:05+00:00

I am having a problem while trying to rotate UIImageview continuously with a ball’s

  • 0

I am having a problem while trying to rotate UIImageview continuously with a ball’s image inside. I would like this ball to spin continuously on its center axis.
I have tried using CGAffineTransform but it didn’t work.

Please help!

  • 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-10T04:11:07+00:00Added an answer on June 10, 2026 at 4:11 am

    This may be an old Q but it’s near the top of search results for the topic. Here’s a more cut and dry solution: (make sure to import QuartzCore/QuartzCore.h)

    CABasicAnimation *rotation;
    rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
    rotation.fromValue = [NSNumber numberWithFloat:0];
    rotation.toValue = [NSNumber numberWithFloat:(2*M_PI)];
    rotation.duration = 1.1; // Speed
    rotation.repeatCount = HUGE_VALF; // Repeat forever. Can be a finite number.
    [yourView.layer addAnimation:rotation forKey:@"Spin"];
    

    Then, to stop remove/reset the animation: (see comments for how to stop-in-place)

    [yourView.layer removeAnimationForKey:@"Spin"];
    

    In swift:

    let rotation = CABasicAnimation(keyPath: "transform.rotation")
    rotation.fromValue = 0
    rotation.toValue = 2 * M_PI
    rotation.duration = 1.1
    rotation.repeatCount = Float.infinity
    view.layer.addAnimation(rotation, forKey: "Spin")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having this problem An error occurred while trying to make a request
While trying to troubleshoot a problem I'm having with a project, I noticed that
Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby
I've been having this problem for a while and it's driving me nuts. I'm
I am having a problem while trying to upload a photo with my iOS
I'm having a problem while trying to dynamically change a table cell's styling class
I am having a problem while trying to refresh data in a Gridview, the
I'm having a weird problem on deployment while trying to use Microsoft Enterprise Library's
I am having a fundamental problem while trying to implement my app using Ext
I'm having a bit of an odd problem while trying to compile some code

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.