在我的项目中,我有两个文件ViewController.swift和ButtonViewController.swift。在ViewController中我有这个代码
var nomeLabel:String!
func goToView(sender: UIButton!) {
// self.performSegueWithIdentifier("goToView", sender: self) // I used This for Go to Second View in Another moment
var label: UILabel = UILabel()
label.frame = CGRectMake(self.view.frame.size.width/2, 10, 150, 21);
label.backgroundColor = UIColor.blackColor()
label.textColor = UIColor.whiteColor()
label.textAlignment = NSTextAlignment.Center
label.text = "\(self.nomeLabel)"
self.myView.addSubview(label)
})
}
现在我想在第二个文件ButtonViewController.swift中获取变量self.nomeLabel的值。如何在ButtonViewController.swift中查看此变量?