Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ViewController: UIViewController {
- private var arrayOfMethods = [String]()
- @IBOutlet var greenLabel: UILabel!
- @IBOutlet var blueLabel: UILabel!
- @IBOutlet var yellowLabel: UILabel!
- override func viewDidLoad() {
- super.viewDidLoad()
- printMessage()
- }
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
- printMessage()
- }
- override func viewDidAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
- printMessage()
- }
- override func viewWillDisappear(_ animated: Bool) {
- super.viewWillDisappear(animated)
- printMessage()
- }
- override func viewDidDisappear(_ animated: Bool) {
- super.viewWillDisappear(animated)
- printMessage()
- }
- func printMessage(line: Int = #line, function: String = #function) {
- print("(title ?? "nil"). Line: (line) of function (function)")
- arrayOfMethods.append(function)
- let string = arrayOfMethods.joined(separator: "n")
- greenLabel.text = "(title ?? "nil") (string)"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement