| Summary: | [Patch] iOS: update joystick accelerometer code to use CoreMotion instead of the deprecated UIAccelerometer | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Alex Szpakowski <amaranth72> |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
| Attachments: | Patch to replace UIAccelerometer code with CoreMotion. | ||
Looks great, thanks! https://hg.libsdl.org/SDL/rev/4a9feef61c85 |
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.