Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Add an @IBAction from the background view to ViewController.swift that responds to Touch Down events. In this method, you will change the background color to

Add an @IBAction from the background view to ViewController.swift that responds to Touch Down events. In this method, you will change the background color to the next color in the sequence. The color sequence should be: black -> white -> light gray -> dark gray -> red -> black. This sequence should repeat indefinitely as the user taps the screen. Use whatever Swift variables, control statements necessary to implement this behavior. To pass the tests, you should use the standard UIColor colors (.black, .white, lightGray, .darkGray and .red)

In ViewController.swift, locate viewDidLoad(). Inside this method, at the bottom, set the background color to .black. This is done so that the first color the user sees on startup is black (our flashlight is conserving battery power :-).

import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago