We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2603 - [Patch] iOS: update joystick accelerometer code to use CoreMotion instead of the deprecated UIAccelerometer
Summary: [Patch] iOS: update joystick accelerometer code to use CoreMotion instead of ...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-24 18:30 UTC by Alex Szpakowski
Modified: 2014-06-25 07:22 UTC (History)
0 users

See Also:


Attachments
Patch to replace UIAccelerometer code with CoreMotion. (15.99 KB, patch)
2014-06-24 18:30 UTC, Alex Szpakowski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Szpakowski 2014-06-24 18:30:48 UTC
Created attachment 1706 [details]
Patch to replace UIAccelerometer code with CoreMotion.

SDL's code for exposing the accelerometer as a joystick on iOS currently uses UIAccelerometer, which was superseded by the CoreMotion framework and deprecated since iOS 5.

The UIAccelerometer code still works (for now), but it also throws deprecation warnings whenever SDL is built for iOS, since SDL's deployment target is no longer below iOS 5.

I've created a patch which replaces the old UIAccelerometer code with a replacement based on the CoreMotion framework. It has identical functionality (to SDL users), however iOS apps are now required to link to the CoreMotion framework when using SDL.
Comment 1 Sam Lantinga 2014-06-25 07:22:52 UTC
Looks great, thanks!
https://hg.libsdl.org/SDL/rev/4a9feef61c85