I have a HomeViewController
that is opening a WelcomeViewController
using segue and is from type Sheet.
In WelcomeViewController
the User is entering information and then closing(dismissing) it. After WelcomeViewController
is closed I want to update HomeViewController
by changing the String
value of a TextField
.
The Problem is, that ViewDidAppear
in HomeViewController
is not called after dismissing WelcomeViewController
. I did not have this Problem before when developing for iOS.
How can I fix this? I tried to call it manually but got problems, because my IBOutlets
were set to nil and I could not change the text in my TextField
.
This is the code that invokes the segue:
self.performSegue(withIdentifier: "welcome", sender: self)
this is my viewDidAppear
in HomeViewController
:
override func viewDidAppear() {
super.viewDidAppear()
if (CoreDataAccess().countUsers() == 0) {
self.performSegue(withIdentifier: "welcome", sender: self)
} else {
//continue execution..
}
}
In WelcomeViewController
I dismiss the ViewController
using this code
dismiss(self)