Complete API reference for the Swift SDK
Parameter | Type | Required | Description |
---|---|---|---|
apiKey | String | Yes | Your Muta API key |
Parameter | Type | Required | Description |
---|---|---|---|
placementId | String | Yes | The ID of the placement to display |
backgroundColor | Color | No | Background color that matches your first placement screen. Defaults to white. |
backgroundHexColor | String | No | Background color as a hex string. Alternative to backgroundColor. |
presentationType | PresentationType | No | Animation style when showing the placement. Defaults to .slide |
loadingView | AnyView? | No | A custom SwiftUI view to show while the placement is loading |
Parameter | Type | Required | Description |
---|---|---|---|
handler | (MutaEvent) -> Void | Yes | The closure to be called when any event occurs |
type | T.Type | Yes | The specific event type to listen for |
handler | (T) -> Void | Yes | The closure to be called when the specific event occurs |
Subscription
object that can be used to unsubscribe from the event.