1
1

More than 1 year has passed since last update.

【SwiftUI】ダブルタップを検知する

Posted at

はじめに

SwiftUIでダブルタップを実装する機会があり、調べると案外簡単に実現できました。
記録しておきます

実装

.onTapGesture(count: 2) {
    // 処理...
}

おわり

countを増やすことでトリプルタップなども実現できそうです。
想像以上に簡単でびっくりしました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1