Skip to content

Instantly share code, notes, and snippets.

@phucnm
Created March 9, 2019 20:38
Show Gist options
  • Save phucnm/4f9d67b562f09b09a323d01a9b275f49 to your computer and use it in GitHub Desktop.
Save phucnm/4f9d67b562f09b09a323d01a9b275f49 to your computer and use it in GitHub Desktop.
TrackingUsage
class Analytics {
static func track(event: AppEvent) {
let mirror = event.mirror
let eventName = mirror.label
let params = mirror.params
// Track the event effortlessly
}
}
enum AppEvent: MirrorableEnum {
case livestreamStarted
case liveStreamEnded(duration: Float)
case gameRoomCreated(gameName: String, invitedFriends: [String])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment