activite1Label 作为标签 1
class StatsViewController: UIViewController {
@IBOutlet weak var activite1Label: UILabel!
@IBOutlet weak var activite2Label: UILabel!
@IBOutlet weak var activite3Label: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
activite1Label.text = activite[0]
activite2Label.text = activite[1]
activite3Label.text = activite[2]
miseAjourTotal()
}
func miseAjourTotal() {
let leLabel = view.viewWithTag(1) as! UILabel
print("leLabel: \(leLabel.text)")
}
}