Swipe is a gesture of sliding a finger across the screen, which has become one of the main ways of interaction in mobile interfaces. From simple photo flipping to deleting emails — swipe has replaced many buttons and made control more natural. According to Apple Human Interface Guidelines (2024), the swipe gesture is the second most frequently used after tap, accounting for 22% of all interactions in mobile applications.
Key Takeaways
Swipe is a gesture where the user slides a finger across the screen in a specific direction, initiating an action. Unlike a tap (short touch), a swipe implies movement and contact with the screen throughout the entire gesture.
The history of swipe began with the first iPhone in 2007 — the “slide to unlock” gesture became the hallmark of mobile interfaces. Today, swipe is used in thousands of applications for navigation, content management, and information organization.
According to UX Planet (2025), applications with gesture control (including swipe) show 18% higher user engagement. Swipe is perceived as a more natural action compared to pressing a button, as it mimics the physical movement of objects.
The main parameters that determine whether a gesture is a swipe are: minimum distance (usually 30–50 pixels), maximum deviation from a straight line (no more than 15–20 degrees), and maximum contact duration (up to 500 ms). If the finger lingers on the screen longer, the gesture is classified as a drag or long press.
By direction of movement, swipes are divided into four main types: left, right, up, and down. Each type has its own purpose and usage context.
| Swipe Type | Action | Usage Example |
|---|---|---|
| Left | Delete, archive, hide | Deleting email in Mail, hiding in Tinder |
| Right | Confirm, view | Like in Tinder, mark as “Read” |
| Up | Refresh, close | Pull-to-refresh, swipe to close the drawer |
| Down | Navigate back, open | Swipe down to go back in iOS, Notification Center |
Horizontal swipes (left/right) are most often used for managing individual items — deletion, archiving, flipping through. Vertical swipes (up/down) — for navigating between screens and refreshing content. According to Material Design Guidelines (2024), horizontal swipe is more convenient for right-handed people: moving the thumb left is more natural on the right hand.
Swipes with two and three fingers are used for advanced actions. Two fingers — switching between desktops on iPad, undo (three-finger swipe). Three fingers — screenshot on some devices. However, multi-finger gestures are less intuitive and require user training.
On iOS, gesture handling is built on UIGestureRecognizer — an abstract class that analyzes a sequence of touch events and determines whether they match a specific gesture.
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let swipeLeft = UISwipeGestureRecognizer(
target: self,
action: #selector(handleSwipe)
)
swipeLeft.direction = .left
view.addGestureRecognizer(swipeLeft)
}
@objc func handleSwipe(sender: UISwipeGestureRecognizer) {
print("Swipe left")
}
}
UISwipeGestureRecognizer supports configuration of direction and number of touches (numberOfTouchesRequired). By default, one finger and right direction are required. To recognize other directions, you need to explicitly specify the direction: .left, .up, .down.
A higher-level API — UICollectionViewLayout with swipe actions support. Since iOS 11, tables and collections support built-in swipe actions through UISwipeActionsConfiguration, allowing you to add delete or archive buttons without manual gesture handling.
On Android, swipe handling is built through GestureDetector — a class that analyzes MotionEvents and calls the corresponding callback methods.
class SwipeActivity : AppCompatActivity() {
private val swipeThreshold = 100
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val gestureDetector = GestureDetector(this, object : GestureDetector.SimpleOnGestureListener() {
override fun onFling(
e1: MotionEvent, e2: MotionEvent,
velocityX: Float, velocityY: Float
): Boolean {
val dx = e2.x - e1.x
if (dx > swipeThreshold) {
println("Swipe right")
}
return true
}
})
}
}
The onFling method in GestureDetector is called when the user quickly swipes a finger across the screen. It receives the starting and ending coordinates (e1, e2) and movement velocity (velocityX, velocityY). To determine the direction, the coordinate difference along the X or Y axis is compared.
The AndroidX library provides a more convenient API: ViewCompat.setSwipeRefreshLayout for pull-to-refresh, RecyclerView with ItemTouchHelper for swipe actions in lists. ItemTouchHelper allows adding swipe functionality with visual feedback — an icon, background color, and animation.
In web development, the Touch Events API (touchstart, touchmove, touchend) and wrapper libraries like Hammer.js or Swiper.js are used to handle swipes.
let startX = 0;
let startY = 0;
const threshold = 50;
element.addEventListener("touchstart", (e) => {
startX = e.touches[0].clientX;
startY = e.touches[0].clientY;
});
element.addEventListener("touchend", (e) => {
const dx = e.changedTouches[0].clientX - startX;
const dy = e.changedTouches[0].clientY - startY;
if (Math.abs(dx) > threshold) {
console.log(dx > 0 ? "Swipe right" : "Swipe left");
}
});
Touch Events API — a native way to handle gestures in the browser. The touchstart event records the starting coordinates, touchmove tracks movement, touchend determines the result. The threshold value filters out accidental touches.
According to Can I Use (2026), Touch Events API is supported by 98% of browsers. For complex gesture scenarios (multiple swipes, direction recognition), it is recommended to use the Hammer.js library, which abstracts low-level handling and provides a clear API.
Successful UX patterns with swipe have formed over years of mobile interface evolution. Using them ensures the user understands how the gesture works without additional training.
The “Swipe to Delete” pattern is the most common. Swiping left on a list item reveals a delete button. Standardized on iOS (SwipeActionsConfiguration) and Android (ItemTouchHelper). Users expect that swiping left deletes or archives an item.
The “Swipe to Go Back” pattern — swiping from the left edge of the screen to return to the previous screen. Became a standard in iOS after iPhone X. On Android, similar navigation works through the system gesture. It is important not to conflict with this system gesture in your own applications.
The “Pull to Refresh” pattern — swiping down to refresh content. Invented by Loren Brichter for Tweetie (2008), now used in millions of applications. Implemented in standard components of both platforms.
Frequently Asked Questions
Swipe is a quick finger movement followed by lifting off. Drag is a slow movement with constant contact. The main difference is in speed: for swipe, the velocity threshold matters, for drag — only the displacement coordinates.
iOS and Android use a threshold of about 30–50 pixels. For web applications, a threshold of 40–60 pixels is recommended. A smaller value leads to false triggers during scrolling, a larger value requires too wide movements.
Determine the gesture priority by direction: horizontal swipe blocks vertical scroll, vertical swipe blocks horizontal scroll. On iOS, use the UIScrollViewDelegate method gestureRecognizerShouldBegin to manage priority.
For standard swipes (delete, go back) training is not required — users are familiar with them. For unique gestures (three-finger swipe, non-standard direction) an onboarding with visual demonstration is required.
Always duplicate swipe actions with buttons. Increase the threshold to 70–100 pixels and the timeout to 800 ms for users with tremors. Use VoiceOver/TalkBack to announce available swipe actions.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also