Created
July 25, 2017 06:58
-
-
Save hudinwal/d726481d6376eedda37328d9a14d0e0e to your computer and use it in GitHub Desktop.
Custom Logs and keys
This file contains 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
import UIKit | |
import Crashlytics | |
class CrashTrackerController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
CLSLogv("CONTROLLER_DID_LOAD - %@",getVaList([self.className])) | |
} | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
// Set the log | |
CLSLogv("CONTROLLER_DID_APPEAR - %@",getVaList([self.className])) | |
// Set the key | |
Crashlytics.sharedInstance().setObjectValue(self.className, forKey: "CONTROLLER_APPEARED") | |
} | |
override func viewDidDisappear(_ animated: Bool) { | |
super.viewDidDisappear(animated) | |
// Set the log | |
CLSLogv("CONTROLLER_DID_DISAPPEAR - %@",getVaList([self.className])) | |
// Set the key | |
Crashlytics.sharedInstance().setObjectValue(self.className, forKey: "CONTROLLER_DISAPPEARED") | |
} | |
deinit { | |
CLSLogv("CONTROLLER_DEALLOCATED - %@",getVaList([self.className])) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment