Swipe in Mobile Apps — Gesture Types and Implementation

Author: IT Sectr Published: 2026-08-03 Reading time: 7 min

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 — a sliding gesture where the finger moves across the screen in a specific direction
  • Directions — horizontal (left/right) and vertical (up/down) swipes
  • Main scenarios — deletion, navigation, tab switching, pull-to-refresh
  • Gesture duration — from 100 to 500 ms, longer durations are recognized as dragging
  • Implementation — UIGestureRecognizer on iOS, GestureDetector on Android, touch events on the web

What is Swipe in Mobile Interfaces

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.

Swipe Recognition Parameters

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.

Types of Swipes by Direction

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 TypeActionUsage Example
LeftDelete, archive, hideDeleting email in Mail, hiding in Tinder
RightConfirm, viewLike in Tinder, mark as “Read”
UpRefresh, closePull-to-refresh, swipe to close the drawer
DownNavigate back, openSwipe 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.

Multi-Finger Swipes

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.

Swipe Implementation on iOS

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.

swift
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.

Swipe Implementation on Android

On Android, swipe handling is built through GestureDetector — a class that analyzes MotionEvents and calls the corresponding callback methods.

kotlin
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.

Swipe in Web Applications

In web development, the Touch Events API (touchstart, touchmove, touchend) and wrapper libraries like Hammer.js or Swiper.js are used to handle swipes.

js
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.

UX Patterns with Swipe

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.

  • Feedback — the element should move with the finger, showing the result before the swipe is completed
  • Gesture conflicts — avoid simultaneously supporting horizontal swipe and scroll on the same element
  • Discoverability — the first swipe actions should be accompanied by a visual hint
  • Cancellation — the user should be able to cancel the swipe by returning the finger to its original position

Frequently Asked Questions

What is the difference between swipe and drag?

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.

What is the minimum distance for swipe recognition?

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.

How to avoid swipe and scroll conflicts?

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.

Do I need to teach the user to swipe?

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.

How to make swipe accessible for users with limited motor skills?

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

  • Swipe — a finger sliding gesture across the screen, the second most popular after tap
  • Types by direction — left (delete), right (confirm), up (refresh), down (go back)
  • Implementation on iOS — UISwipeGestureRecognizer, UISwipeActionsConfiguration for lists
  • Implementation on Android — GestureDetector.onFling, ItemTouchHelper for RecyclerView
  • Implementation on the web — Touch Events API or Hammer.js, Swiper.js libraries
  • UX patterns — swipe to delete, swipe to go back, pull to refresh — time-tested solutions

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.

Discuss the project

Read also