更改标签

时间:2016-04-12 08:23:02

标签: swift uilabel viewcontroller

我已经创建了一个功能良好的登录页面,但登录后我希望用户每次使用登录时都能确认他/她的数据

问题是我可以将电子邮件地址输入另一个UIViewController,但是我无法更改显示电子邮件的标签文本,并且说明了解开nil ....

import Foundation
import UIKit

class userIdConfirmationViewController : UIViewController {



    var emailHolder = String()


    @IBOutlet var emailConfirmation: UILabel!

    @IBOutlet var nameConfirmation: UITextField!

    @IBOutlet var usernameConfirmation: UITextField!

    override func viewDidLoad() {
         //here is the Error              
         emailConfirmation.text = emailHolder
    }

    @IBAction func ConfirmationButton(sender: UIButton) {
        let email = emailConfirmation.text
        let name = nameConfirmation.text
        let username = usernameConfirmation.text

        print (" email : \(email)       name : \(name)      username : \(username)" )



    }

}

0 个答案:

没有答案