Code: Select all
var body: some View {
ZStack {
Button(intent: TappIntent()) {
ZStack {
Color.clear
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.buttonBorderShape(.automatic)
.buttonStyle(NoHighlightButtonStyle())
}
}
public struct TappIntent: AppIntent {
public static var title: LocalizedStringResource = "Did Tap Widget"
public func perform() async throws -> some IntentResult & OpensIntent {
print("TouchIntent was called", level: .INFO)
SharedAnalytics(type: "Widget").event("Regular Tap")
return .result(opensIntent: OpenAppIntent())
}
}