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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:16:57+00:00 2026-05-17T15:16:57+00:00

Is there a way to let a view rotate forever, with an specified speed?

  • 0

Is there a way to let a view rotate forever, with an specified speed? I need that for an indicator kind of thing. I know there is this weird Lxxxxx00ff constant (don’t remember it exactly) that stands for “forever”.

  • 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-17T15:16:58+00:00Added an answer on May 17, 2026 at 3:16 pm

    You can use HUGE_VAL for floating value (if I remember correctly, repeatCount property for animation is a float).

    To setup animation you can create CAAnimation object using +animationWithKeyPath: method:

    CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    animation.fromValue = [NSNumber numberWithFloat:0.0f];
    animation.toValue = [NSNumber numberWithFloat: 2*M_PI];
    animation.duration = 3.0f;
    animation.repeatCount = HUGE_VAL;
    [rotView.layer addAnimation:animation forKey:@"MyAnimation"];
    

    If I remember correctly creating this kind of rotation using just UIView animations is impossible because rotations on 360 degrees (2*M_PI radians) are optimized to no rotation at all.


    Edit: Added a Swift version.

        let animation = CABasicAnimation(keyPath: "transform.rotation.z")
        animation.fromValue = NSNumber(value: 0.0)
        animation.toValue = NSNumber(value: 2*Double.pi)
        animation.duration = 3.0
        animation.repeatCount = Float.greatestFiniteMagnitude
        rotView.layer.add(animation, forKey: "MyAnimation")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to link to another View that displays search results without
Is there a clever way to let the user switch between hide and view
Is there any way to let user pick color from screen ? Like the
QUESTION: Re use of .NET Backgroundworker, is there not a way to let exceptions
Is there any way to check step by step what's going on in let's
Is there any way to have a default MessageBox.Show() caption? Let says I would
Is there any way to get mouse position relative to it's parent element? Let's
Is there any way to make extension to pop up when event occurs? Let's
Is there any way to get PDF document text language? Example: Let's say I
Let's say I have 10 threads running simultaneously. Is there any way of calling

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.