December 2015
Intermediate to advanced
400 pages
13h 3m
English
Your model class is now ready. Return to your controller in ViewController.swift. Add an instance of TodoList as a new property and change addButtonPressed(_:) to add items to todoList instead of printing them.
Listing 27.6 Adding the model class to the controller as a property (ViewController.swift)
class ViewController: UIViewController {
@IBOutlet var itemTextField: UITextField!
@IBOutlet var tableView: UITableView!
let todoList = TodoList() 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. } @IBAction ...Read now
Unlock full access