Skip to main content
added 8 characters in body
Source Link
Shehata Gamal
  • 100.6k
  • 8
  • 75
  • 95

You miss a point that is whenever you create a new instance of the vc it's viewDidLoadviewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop itthat child from the stack

Inject the setup code inside viewDidLoadviewDidLoad , and any content that you want to refresh set it in viewWillAppearviewWillAppear/viewDidAppearviewDidAppear for ex suppose you have a table lists some items and you add the item in a modal vc , then you go place tableView.reloadData() in viewWillAppear , but for adding the tableView to the view , you make that inside viewDidLoad

You miss a point that is whenever you create a new instance of the vc it's viewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop it from the stack

Inject the setup code inside viewDidLoad , and any content that you want to refresh set it in viewWillAppear/viewDidAppear for ex suppose you have a table lists some items and you add the item in a modal vc , then you go place tableView.reloadData() in viewWillAppear , but for adding the tableView to the view , you make that inside viewDidLoad

You miss a point that is whenever you create a new instance of the vc it's viewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop that child from the stack

Inject the setup code inside viewDidLoad , and any content that you want to refresh set it in viewWillAppear/viewDidAppear for ex suppose you have a table lists some items and you add the item in a modal vc , then you go place tableView.reloadData() in viewWillAppear , but for adding the tableView to the view , you make that inside viewDidLoad

added 354 characters in body
Source Link
Shehata Gamal
  • 100.6k
  • 8
  • 75
  • 95

You miss a point that is whenever you create a new instance of the vc it's viewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop it from the stack

Inject the setup code inside viewDidLoad , and any content that you want to refresh set it in viewWillAppear/viewDidAppear for ex suppose you have a table lists some items and you add the item in a modal vc , then you go place tableView.reloadData() in viewWillAppear , but for adding the tableView to the view , you make that inside viewDidLoad

You miss a point that is whenever you create a new instance of the vc it's viewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop it from the stack

You miss a point that is whenever you create a new instance of the vc it's viewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop it from the stack

Inject the setup code inside viewDidLoad , and any content that you want to refresh set it in viewWillAppear/viewDidAppear for ex suppose you have a table lists some items and you add the item in a modal vc , then you go place tableView.reloadData() in viewWillAppear , but for adding the tableView to the view , you make that inside viewDidLoad

Source Link
Shehata Gamal
  • 100.6k
  • 8
  • 75
  • 95

You miss a point that is whenever you create a new instance of the vc it's viewDidLoad is called once , that means if you dismiss that vc or pop it ( if it's inside a navigation controller ) then it completely deallocates ( if no strong references exists ) , that's a story with 1 instance , if you presented another instance it'll go the same , But

For the lifeTime of 1 instance viewDidLoad is called once , and viewWillAppear/viewDidAppear are called whenever you dismiss a vc that's presented by that instance or pop it from the stack