Skip to main content
Logo Appt Light

Input motion on iOS

Provide an alternative way for actions activated by motion, to allow everyone to use the functionality. For example, for users with limited hand function, shaking is not always possible. Also make it possible to disable actions activated by motion. For example, for users with spasms, these actions could be triggered accidentally.

On iOS, it is common to use the motionEnded method to detect motion.

A motion event should not be the only way to trigger actions. Make sure to provide a second way, such as a button, to trigger the same action.

import UIKit

class MotionController: UIViewController {

    override var canBecomeFirstResponder: Bool{
        return true

    override func viewDidAppear(_ animated: Bool) {

    override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
        // Provide alternative


Let us know!