Created
March 9, 2019 20:38
-
-
Save phucnm/4f9d67b562f09b09a323d01a9b275f49 to your computer and use it in GitHub Desktop.
TrackingUsage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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