Untitled
unknown
plain_text
2 years ago
755 B
21
Indexable
import UIKit
class GymAppViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Create a label and set its text to "Welcome to the Gym App!"
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 320, height: 40))
label.text = "Welcome to the Gym App!"
view.addSubview(label)
// Create a button and set its title to "Start Workout"
let button = UIButton(frame: CGRect(x: 0, y: 40, width: 320, height: 40))
button.setTitle("Start Workout", for: .normal)
button.addTarget(self, action: #selector(startWorkout), for: .touchUpInside)
view.addSubview(button)
}
@objc func startWorkout() {
// TODO: Start the workout
}
}
Editor is loading...