There are two equivalent ways to present the flow. Both take an eventId and run the complete purchase experience.
.zuuppaTickets(isPresented:eventId:) wires up a full-screen cover for you and flips the binding back to false when the buyer closes the flow.
import SwiftUI
import zsdk_swift
struct EventButton: View {
@State private var showTickets = false
var body: some View {
Button("Buy Tickets") { showTickets = true }
.zuuppaTickets(
isPresented: $showTickets,
eventId: "your-event-uuid"
)
}
}func zuuppaTickets(
isPresented: Binding<Bool>,
eventId: String,
config: ZuuppaConfig = .default,
onWalletPayment: ZuuppaWalletPaymentHandler? = nil
) -> some View| Parameter | Type | Description |
|---|---|---|
isPresented | Binding<Bool> | Controls presentation. The SDK sets it to false when the buyer closes the flow. |
eventId | String | The Zuuppa event UUID to sell tickets for. Required. |
config | ZuuppaConfig | Backend configuration. Defaults to production — see Configuration. |
onWalletPayment | ZuuppaWalletPaymentHandler? | Optional in-app wallet handler. See In-app wallet payments. |
Use ZuuppaTicketsScreen directly when you want to control presentation or run code in onFinish.
.fullScreenCover(isPresented: $showTickets) {
ZuuppaTicketsScreen(eventId: "your-event-uuid") {
// onFinish — buyer closed the flow
showTickets = false
}
}public init(
eventId: String,
config: ZuuppaConfig = .default,
onWalletPayment: ZuuppaWalletPaymentHandler? = nil,
onFinish: @escaping () -> Void = {}
)| Parameter | Type | Description |
|---|---|---|
eventId | String | The Zuuppa event UUID. Required. |
config | ZuuppaConfig | Backend configuration. Defaults to production. |
onWalletPayment | ZuuppaWalletPaymentHandler? | Optional in-app wallet handler. |
onFinish | () -> Void | Called when the buyer dismisses the flow (unlike the modifier, this is exposed here). |
eventId.The flow adapts to how the event is configured on the Zuuppa backend:
onWalletPayment handler and the event is crypto-enabled.