Looking at how to implement the magic tap in SwiftUI? There is an accessibilityAction(::) with an action kind parameter, you can pass .magicTap, and a closure to handle that action.
A reminder of what the magic tap is: https://x.com/dadederk/status/1548791545800888322?s=20&t=ZakzzXNfLk0-2kpYqD5v3A
You may also find interesting...

With regular buttons from UIKit or SwiftUI, you are all set. With complex views, headings, or table/collection view cells that, when selected, bring the user somewhere else in the app or perform an action, you'll have to add the button trait.
You can pass the .escape AccessibilityActionKind to the accessibilityAction(_:_:) modifier, to implement the perform escape gesture in SwiftUI. A reminder of how perform escape works: https://x.com/dadederk/status/1549066893377830913?s=20&t=Aog7ojR4E4eG4M3hd-cn3w
Guidelines from Apple: Begin with a verb that explains the results of the action. Avoid using the imperative form of a verb because that can make it sound like a command. Don’t include the action type. Don’t include the control. https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilityhint