I'm working on some code to make a random name generator in swift/xcode. currently, it tells me that there is a problem with the override function and both of my "viewDidLoads". I'd appreciate any and all help thank you.
`````````````````````````````````````````````````````````````````````````````````````````
// ViewController.swift
// name gen
//
// Created by Idrock niltag on 10/20/21.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var label : UILabel!
override func ViewDidLoad() {
super.ViewDidLoad()
}
@IBAction func randomWord(_ sender: Any) {
let array = [ "brock", "ash", "misty", "mai","mia","edgeworth"]
label.text = array.randomElement()
}
}
Aucun commentaire:
Enregistrer un commentaire