Untitled

mail@pastecode.io avatar
unknown
swift
2 months ago
771 B
3
Indexable
Never
class ViewController: UIViewController {
    override func viewDidLoad() {
        print("2")

        DispatchQueue.main.async {
            print("3")

            DispatchQueue.global().async {
                print("5")
            }

            DispatchQueue.global().sync {
                print("4")

                DispatchQueue.global().sync {
                    print("7")
                }
            }
        }
    }

    override func viewWillAppear(_ animated: Bool) {
        DispatchQueue.main.async {
            print("8")
        }
    }

    override func viewDidAppear(_ animated: Bool) {
        DispatchQueue.main.async {
            print("9")
        }
    }
}

print("1")
let controller = ViewController()
let _ = controller.view
print("6")
Leave a Comment