Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Manage Edge Gestures

How to Manage Edge Gestures

Tachibana Kaoru

June 21, 2018
Tweet

More Decks by Tachibana Kaoru

Other Decks in Technology

Transcript

  1. Swipe When performed with one finger, returns to the previous

    screen, reveals the hidden view in a split view controller, reveals the Delete button in a table-view row, or reveals actions in a peek. When performed with four fingers on an iPad, switches between apps. ग़యɿApple Human Interface Guideline
  2. Handle Edge Pan Gesture let edgeGestureLeft = UIScreenEdgePanGestureRecognizer( target: self,

    action: #selector(onEdgePanGesture(_:))) edgeGestureTop.edges = .left gestureView.addGestureRecognizer(edgeGestureLeft)
  3. To Prevent System Gestures… override func preferredScreenEdgesDeferringSystemGestures() -> UIRectEdge {

    // edge to prevent system gestures. // .top,.left,.right,.bottom,.all return .top } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) setNeedsUpdateOfScreenEdgesDeferringSystemGestures() }
  4. Who to prevent system gestures? Don’t block systemwide screen-edge gestures.

    In addition to the standard gestures, some additional gestures invoke systemwide actions like revealing the Home screen (on supported iPhones), Control Center, Notification Center, and the Dock (on iPad) by swiping from an edge of the screen. People rely on these gestures to work in every app. In rare cases, immersive apps like games might require custom screen-edge gestures that take priority over the system's gestures—the first swipe invokes the app- specific gesture and a second-swipe invokes the system gesture. This behavior (known as edge protect) should be implemented sparingly, as it makes it harder for people to access the system-level actions. ग़యɿApple Human Interface Guideline
  5. Who to prevent system gestures? Don’t block systemwide screen-edge gestures.

    In addition to the standard gestures, some additional gestures invoke systemwide actions like revealing the Home screen (on supported iPhones), Control Center, Notification Center, and the Dock (on iPad) by swiping from an edge of the screen. People rely on these gestures to work in every app. In rare cases, immersive apps like games might require custom screen-edge gestures that take priority over the system's gestures—the first swipe invokes the app- specific gesture and a second-swipe invokes the system gesture. This behavior (known as edge protect) should be implemented sparingly, as it makes it harder for people to access the system-level actions. ग़యɿApple Human Interface Guideline Don’t do it!