Post

Replies

Boosts

Views

Activity

Reply to SwiftUI on macOS: double tap on list item
Use simultaneously gesture detection. Sample below :) @State var selectedItem: URL? List(items, selection: $selectedItem) { url in                 let selectGesture = TapGesture()                     .onEnded {                         selectedItem = url                     }                 let openGesture = TapGesture(count: 2)                     .onEnded {                         print("double clicked")                     }                 ItemRow(url)                     .gesture(openGesture.simultaneously(with: selectGesture)) }
Mar ’22