Noha Mohamed Noha Mohamed - 1 month ago 12
Objective-C Question

Which functions are called once widget disappear?

Function

viewDidLoad()
isn't called once widget disappeared.

Answer

viewDidLoad() is called exactly once in a views lifecycle.

Depending on your needs, use:

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    // do stuff you want to do before the view actually appears
} 

or:

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    // do stuff you want to do when the view appears
} 

For detailed information regarding a UIViews lifecycle visit Apples Documentation

Comments