I'm on a view (lets say VC1) which is at the top of navigation stack. I click on another Tab and come back to this view, content in VC1 reloads. How do I stop reloading content in this situation as reloading doesn't make any sense since view is already loaded with content.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
loadContent()
}
You can't stop
viewWillAppearto be called from 2 same actions like switching tab or poping a covering vc , so you need to removeviewWillAppearand assign a delegate for the vc you need to reload after it's pop to callloadContent