Skip to content

SwiftUI

.product(name: "CimkaSwiftUI", package: "cimka-sdk-ios")

No registration is needed — just use the modifiers below.

import CimkaSwiftUI

Mark the root of each screen. This logs a screen view plus screen_enter / screen_exit, and sets the screen name that clicks inside it inherit.

var body: some View {
VStack { /* ... */ }
.cimkaScreen("Home")
}

For screens you can’t otherwise name (sheets, dialogs, tabs), add .cimkaScreen("…") to their content root.

Logs a tap, then runs your action. Pass label (e.g. the button’s text) for a clean element id and log entry.

Button("Continue") { onContinue() }
.cimkaClick(label: "Continue")
Button("Skip") { skip() }
.cimkaClick(label: "Skip", elementId: "home_skip") // explicit id
Parameter Default Description
label nil Human-readable label shown in the dashboard.
elementId nil Stable id. If omitted, derived from label ("Go to cart" → go_to_cart), else auto-generated.
action — Your tap handler.

Track taps on list rows with the list and item identity, so the id stays stable as rows reorder:

ForEach(products) { product in
ProductRow(product)
.cimkaListItem(listId: "products", itemId: product.id, label: product.name) {
open(product)
}
}

Items are logged as products[<itemId>].