Share
Embed
Transcript
25 slides
-
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 -
Handle Edge Pan Gesture let edgeGestureLeft = UIScreenEdgePanGestureRecognizer( target: self,
action: #selector(onEdgePanGesture(_:))) edgeGestureTop.edges = .left gestureView.addGestureRecognizer(edgeGestureLeft) -
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() } -
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 -
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!