0

I was looking to replicate the functionality contained in the native iOS Clock and Contacts apps for list items. After pressing "Edit" at the top right, red "minus" circles appear on the left side of each list item. If you press the minus sign, it "swipes" the list item to the right and shows the "Delete" swipeAction: Contacts Groups List View Contacts Groups List Edit View Contacts Groups List Edit View - Swipe Action Active

I can set the swipeActions for a list item easily, and can replicate the edit button. As well as adding the minus buttons when editing the list (I used an HStack with a Button and Text view inside). What I cannot find anywhere is how to have the button action show the swipe action. All related posts comment on having the button action closure run the code that a gesture would typically activate. From what I understand, the gesture handling is done inside of SwiftUI itself for swipeActions, and I cannot find a way that you could imitate the result. Would this be something that would have to be done in UIKit? Or would I have to build a custom version of swipeActions to implement the same feature?

I have tried researching imitating gestures on Views, but everything seems to say it is not possible to do so

0 Answers0