CHAPTER 7 ■ IOT PATTERNS: ON-DEMAND CLIENTS
Your screen layout is ready and should look similar to Figure 7-27.
Figure 7-27. Final screen layout of app
Screen Logic
Next you are going to add some logic that will make the screen interactive. Whenever the
user taps on the Click to Refresh button, the app will check the server for open parking
spot information.
Open the ViewController.swift file side by side with the storyboard. As shown
in Listing 7-9 , by default there will be two functions, called viewDidLoad() and
didReceiveMemoryWarning() , that were auto-generated by the system. You are not going
to make any changes to these functions.
Listing 7-9. Default Code for ViewController.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically
// from a nib.
}