polish iOS study flow
This commit is contained in:
@@ -1,13 +1,28 @@
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
protocol AnalyticsTracking {
|
||||
func track(_ event: String, attributes: [String: String])
|
||||
}
|
||||
|
||||
final class HermesAnalyticsClient: AnalyticsTracking {
|
||||
struct HermesTrackedEvent: Identifiable, Equatable {
|
||||
let id = UUID()
|
||||
let event: String
|
||||
let attributes: [String: String]
|
||||
let timestamp: Date
|
||||
}
|
||||
|
||||
@MainActor
|
||||
final class HermesAnalyticsClient: ObservableObject, AnalyticsTracking {
|
||||
@Published private(set) var trackedEvents: [HermesTrackedEvent] = []
|
||||
|
||||
func track(_ event: String, attributes: [String: String]) {
|
||||
// Scaffold implementation.
|
||||
_ = event
|
||||
_ = attributes
|
||||
trackedEvents.append(
|
||||
HermesTrackedEvent(
|
||||
event: event,
|
||||
attributes: attributes,
|
||||
timestamp: Date()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user