Post

Replies

Boosts

Views

Activity

[SWIFT] Accessing and controlling @IBOutlet variables from other ViewControllers.
I am having trouble accessing and controlling @IBOutlet variables from other ViewControllers. More specifically, I want to control that @IBOutlet variable based on real-time changes in the variable value of another ViewController. Control is possible in the viewcontainer that contains the @IBOutlet variable, but when trying to control it from another viewcontainer, the message "Thead1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value" appears. Is there any possible way to do it? I think this will be difficult since thread1 in the error message means the main thread, so I tried to create a thread in the viewcontainer that has the @IBOutlet variable and access the variable of another viewcontainer to control the @IBOutlet variable inside the thread, but in this case, the variable value of the other viewcontainer that changes in real time is fixed to the value at the moment the thread is created, and the value that changes in real time after that cannot be retrieved. And I don't think using threads for this purpose is a good way. I sincerely ask for help from all the experts. If I can solve this, it will be easy to create the rest of the app structure. Sincerely !
0
0
51
12h