Skip to content

Instantly share code, notes, and snippets.

@manijshrestha
Created October 14, 2018 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manijshrestha/e59875d0ecc8c8d23784ef831f1b941c to your computer and use it in GitHub Desktop.
Save manijshrestha/e59875d0ecc8c8d23784ef831f1b941c to your computer and use it in GitHub Desktop.
Kotlin Multiplatform ViewController.swift
import UIKit
import common
class ViewController: UIViewController {
let anatlyicsManager = IosAnalyticsManager()
override func viewDidLoad() {
super.viewDidLoad()
// Report page is viewed
anatlyicsManager.report(event: ViewEvent.init(pageName: "Main Page"))
}
@IBAction func redButtonClicked(_ sender: Any) {
anatlyicsManager.report(event: ButtonClickEvent.init(buttonName: "Red"))
}
@IBAction func greenButtonClicked(_ sender: Any) {
anatlyicsManager.report(event: ButtonClickEvent.init(buttonName: "Green"))
}
@IBAction func blueButtonClicked(_ sender: Any) {
anatlyicsManager.report(event: ButtonClickEvent.init(buttonName: "Blue"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment