Look, I have time looking for how to instantiate class to access properties ... I've seen everywhere that they do this ...
let vc = otroViewController()
vc.label.backgroundColor = UIColor.black // por ejemplo una etiqueta para cambiar su fondo
I've also done this but it's obviously the same:
var vc: otroViewController? = nil // incluso sin usar nil
and in viewdidload
viewDidLoad() {
vc = OtroViewController() // tambien "otroViewController.self"
y "self.otroViewController"
}
but by doing this:
let vc = otroViewController()
A NEW Viewcontroller is being created ... and therefore the properties are not what I need to call, and I could not call those properties of the class to access them and get the data of that class
I have several questions:
Do you need to create some initializer like get and set?
Does the class type matter? "either UICollectionViewCell or UIViewController, NSObject ... etc"
or use the delegates? "I have researched but it is not clear to me yet"
or use a segue? - > it exists to do it in a "programatical" way since I do not use Storyboards at all
Does anyone know about this or did the same thing happen to them?