SHARE
TWEET

Untitled

a guest Jun 25th, 2019 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ViewController: UIViewController {
  2.  
  3. private var arrayOfMethods = [String]()
  4.  
  5. @IBOutlet var greenLabel: UILabel!
  6. @IBOutlet var blueLabel: UILabel!
  7. @IBOutlet var yellowLabel: UILabel!
  8.  
  9. override func viewDidLoad() {
  10.     super.viewDidLoad()
  11.     printMessage()
  12. }
  13.  
  14. override func viewWillAppear(_ animated: Bool) {
  15.     super.viewWillAppear(animated)
  16.     printMessage()
  17. }
  18.  
  19. override func viewDidAppear(_ animated: Bool) {
  20.     super.viewWillAppear(animated)
  21.     printMessage()
  22. }
  23.  
  24. override func viewWillDisappear(_ animated: Bool) {
  25.     super.viewWillDisappear(animated)
  26.     printMessage()
  27. }
  28.  
  29. override func viewDidDisappear(_ animated: Bool) {
  30.     super.viewWillDisappear(animated)
  31.     printMessage()
  32. }
  33.  
  34. func printMessage(line: Int = #line, function: String = #function) {
  35.     print("(title ?? "nil"). Line: (line) of function (function)")
  36.     arrayOfMethods.append(function)
  37.     let string = arrayOfMethods.joined(separator: "n")
  38.     greenLabel.text = "(title ?? "nil") (string)"
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top