标签插座无法通过swift 3中的其他视图控制器进行编辑

时间:2017-07-18 08:54:25

标签: ios xcode swift3

我想更改登录屏幕userName Outlet,但它无法正常工作我找不到我们的解决方案

handlers:
- url: /assets
  static_dir: dist/assets
  login: required
- url: /dist
  static_dir: dist
  login: required
- url: /.*
  script: app.server.main.app
  secure: always
  login: required

1 个答案:

答案 0 :(得分:0)

试试这个:

let loginVC = storyboard?.instantiateViewController(withIdentifier: "LoginViewController") as! LoginViewController
if self.emailTextField.text == "" 
{
    loginVC.str = "Hello"
} 
else 
{
    loginVC.str = self.emailTextField.text!
}
navigationController?.pushViewController(loginVC, animated: true)

<强> LoginViewController

class LoginViewController: UIViewController 
{
    var str:String! = nil
    override func viewDidLoad() 
    {
       super.viewDidLoad()
       self.userName.text = str
    }
}