Question: // // ViewController.swift // Gill.light // // Created by Amado Gil on 2/20/23. // import UIKit class ViewController: UIViewController { var lightOn = true override

//

// ViewController.swift

// Gill.light

//

// Created by Amado Gil on 2/20/23.

//

import UIKit

class ViewController: UIViewController {

var lightOn = true

override func viewDidLoad() {

super.viewDidLoad()

updateUI()

// Do any additional setup after loading the view.

}

func updateUI() {

view.backgroundColor = lightOn ? .white : .black

}

@IBAction func buttonPressed(_ sender: UIButton) {

lightOn.toggle()

updateUI()

}

}

SWIFT LANGUAGE

By the end of this guided project, you'll have created an app named Light that changes the screen from black to white and back again when the user taps a button.

I'm having issued with my application running properly. When I run simulator, an error shows (see picture attached). Please help find solution to fix this. // // ViewController.swift // Gill.light // // Created by Amado Gil on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!