This is an API client generated by the OpenAPI Generator project.
- API version: 1.0.0
- Package version: 1.0.0
target MyApp do
pod 'TopsortSDK', '~> 1.0.0'
end
And run pod install
github "Topsort/CocoaSDK" ~> 1.0.0
And run carthage update
let package = Package(
dependencies: [
.package(url: "https://github.com/Topsort/CocoaSDK", from: "1.0.0"),
],
targets: [
.target(
name: "MyApp",
dependencies: ["TopsortSDK", ]
)
]
)
And run swift package update
struct TopsortProduct : View {
var topsort: TopsortSDK
var product: Product
var body: some View {
MyProduct(...)
.onGestureTap() {
Task {
let event = HitEvent(,
productId: product.productId,
auctionId: product.auctionId,
resolvedBidId: product.resolvedBidId,
)
try? await topsort.logHitAsync(hitEvent)
}
}
}
}
struct Content : View {
var products: [Products]
var body: some View {
LazyVGrid(columns: columns, spacing: 2) {
ForEach(products, id: \self) { product in
TopsortProduct(product: product)
}
}
.task {
try? await topsort.logImpressionsAsync(impressions: products.map { p in
Impression(productId: p.productId, auctionId: p.auctionId, resolvedBidId: p.resolvedBidId)
})
}
}
}