1

I want to detect the device motion like Panorama i.e. motion from my left side to Right side.

I tried with the accelerometer but i can't able to do it.

I like to move one image in a straight line as the device move.

My code is as follow:

- (void)viewDidLoad
{
    [super viewDidLoad];
    [[UIAccelerometer sharedAccelerometer] setUpdateInterval:1/60];
    [[UIAccelerometer sharedAccelerometer]setDelegate:self];
}

pragma mark - Accelerometer Delegate

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

    valueX = acceleration.x*100.0;
    valueY = acceleration.y*30.0;

    float newX = (float)(ball.center.x + valueX);

    CGPoint newCenter = CGPointMake(newX, 50);
    ball.center = newCenter;

}

How can I do this? Because there are many apps who uses this.

Please guide me.

Thanks..

Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
user2526811
  • 1,233
  • 4
  • 20
  • 54
  • Try this link http://stackoverflow.com/questions/14062932/libraries-to-capture-panorama-in-ios-6 – Rohan Sep 13 '13 at 06:26
  • Also try out these links https://github.com/SpotMetrix/Panoramic , http://krpano.com/docu/html5/ – Rohan Sep 13 '13 at 06:37

0 Answers0