Sorry for my beginner programmer ignorance. I followed the above tips but it gives an error when I make self
:
Can not assign value of type "MainPageValueController" to type "ViewPasswordController".
TelaAjustesViewController
is the Screen 1 of your 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)