0
Excuse my ignorance of beginner programmer. I followed the tips above but it makes a mistake when I do the self
:
Cannot assign value of type "Telaprincipalviecontroller" to type "Telaajustesviewcontroller".
TelaAjustesViewController
is the Screen 1 of his example and the TelaPrincipalViewController
is the 2.
The value that comes from Screen 1, is the content of Cor
.
import UIKit
class TelaPrincipalViewController: UIViewController { var TransfereCor:TelaAjustesViewController!
override func viewDidLoad()
{
let v2 = TelaPrincipalViewController ()
v2.TransfereCor = self
switch TransfereCor.Cor
{
case 0:
print("Escuro")
break
case 1:
print("Claro")
break
case 2:
print("Daltônico")
break
default:
break
}
print(TransfereCor.Cor)