简体   繁体   中英

viewDidLoad() want to call everytime when I press tab cell in iOS

In my tableView , when I press tab cell first time it calls viewDidLoad() but the other time that doesn't call viewDidLoad() . How to solve that problem. I want to call viewDidLoad() every time I press tab view in my code.

ViewDidLoad will be called when the view was loaded into memory. You want to use the ViewWillAppear function this will be called every time the view is about to get active.

override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated);
}

In my opinion viewDidLoad() will called only one time, viewWillAppear() will be called everytime page is loaded. So you need to write source code to viewWillAppear() which might be call everytime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM