Questions tagged [viewcontroller-lifecyle]

7 questions
41
votes
6 answers

Swift viewWillAppear not being called after dismissing view controller

I am presenting a view controller from a view controller called HomeController like so: let viewController = self.storyboard?.instantiateViewController(withIdentifier: "LoginController") as! LoginController let navigationController:…
user979331
  • 11,039
  • 73
  • 223
  • 418
8
votes
6 answers

viewDidLoad is called twice

My viewDidLoad in a view controller is called twice. Once by [UIViewController View] and a second time by [UINib instanciateWithOwner:Options]. Why is this happening? Can it be prevented?
saman01
  • 924
  • 4
  • 12
  • 25
1
vote
1 answer

How to call embedded ViewControllers lifecycles in UIScrollView - Swift - Programmatically

I am creating a scrollView that is able to display ViewController views one after the other. This is the code I implemented: scrollView.contentSize = CGSize(width: screenWidth * 3, height: screenHeight) let firstVC = FirstViewController() …
1
vote
0 answers

@IBOutlet View is nil on viewDidDisappear

i have problem on a custom view used in a viewController. Assume custom xib view (AddButtonWithOptions, a button which shows some options when tapped) is being added to ViewController with interface builder. And on the viewDidDisappear function, i…
0
votes
2 answers

View will appear is not firing when we dismiss notification settings overlay

I have a view controller when a button clicked I'm taking the user to app settings. UIApplication.openApplicationSettings() When I come back from appsettings to app then viewwillappear method is not firing. or is there any other method that will…
0
votes
2 answers

viewWillAppear not being called after popToRootViewController

This is the flow: VC1 ->(PUSH)-> VC2 ->(PUSH) -> VC3 When clicking a button in VC3 I am calling the method below and it works properly - taking me back to VC1: self.navigationController?.popToRootViewController(animated: false) But the problem is…
0
votes
2 answers

How To Ensure Vue Main Template Create Method Finishes Before Router-View Inner Template Create Method Starts

I have a simple setup with a main Vue template like this: