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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:14:24+00:00 2026-06-16T08:14:24+00:00

I am searching for a good and fluid way to move multiple UIViews over

  • 0

I am searching for a good and fluid way to move multiple UIViews over the Screen at once. The Action should happen when the Accelerometer detects acceleration. I have already tried this way:

- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{

    CGPoint ObjectPos = Object.center;

    ObjectPos.x -= acceleration.x;

    Object.center = ObjectPos;
}

(of course I added some tweaking to improve the movement detection), but all in all, it still is not very fluid.

I hoped there is some way with core animation, but it does not seem to work with the acceleration pretty well.

Help is really appreciated, thanks!

  • 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-16T08:14:25+00:00Added an answer on June 16, 2026 at 8:14 am

    I advise you to read this piece of documentation: Isolating the Gravity Component from Acceleration Data and the section below that called ‘Isolating Instantaneous Motion from Acceleration Data’.

    Basically, you need to filter out gravity in order to get smooth movement. The link provides sample-code.

    Edit: UIAccelerometer was deprecated in iOS 5.0, and the accompanying documentation seems to be gone as well.

    For future reference I did some digging and found, what seems to be, a ‘carbon copy’ of the original sample code (source):

    // This example uses a low-value filtering factor to generate a value that uses 10 percent of the
    // unfiltered acceleration data and 90 percent of the previously filtered value
    
    
    // Isolating the effects of gravity from accelerometer data
    #define kFilteringFactor 0.1
    - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
        // Use a basic low-pass filter to keep only the gravity component of each axis.
        accelX = (acceleration.x * kFilteringFactor) + (accelX * (1.0 - kFilteringFactor));
        accelY = (acceleration.y * kFilteringFactor) + (accelY * (1.0 - kFilteringFactor));
        accelZ = (acceleration.z * kFilteringFactor) + (accelZ * (1.0 - kFilteringFactor));
        // Use the acceleration data.
    }
    
    // shows a simplified high-pass filter computation with constant effect of gravity.
    
    // Getting the instantaneous portion of movement from accelerometer data
    #define kFilteringFactor 0.1
    - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
        // Subtract the low-pass value from the current value to get a simplified high-pass filter
        accelX = acceleration.x - ( (acceleration.x * kFilteringFactor) + (accelX * (1.0 - kFilteringFactor)) );
        accelY = acceleration.y - ( (acceleration.y * kFilteringFactor) + (accelY * (1.0 - kFilteringFactor)) );
        accelZ = acceleration.z - ( (acceleration.z * kFilteringFactor) + (accelZ * (1.0 - kFilteringFactor)) );
        // Use the acceleration data.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been searching for a good way in which to style up a selectbox,
Possible Duplicate: Split string with delimiters in C I'm searching a good way to
I am searching for a good method to transfer data over internet, and I
Good day, I have been searching for a way to format output using writeline/write
Few days ago I went into searching for a good way to make a
After searching online for quite some time, I cannot find a good way to
i am searching a good book to learn ADO.NET 4.0, book should be excellent
I'm searching for a good way to bind a List<string> to a form in
I'm searching for a good way for managing my view models and especially the
I've been searching around for a good way to implement the hierarchy below. I've

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.