April 2017
Intermediate to advanced
316 pages
9h 33m
English
We will use DetailsViewController to present the details of a Todo item and modify it. We will have three textField and a switch. We will observe the changes in the UI and modify the State and backend. The code is as follows:
import UIKit import ReactiveCocoa import ReactiveSwift class DetailsViewController: UIViewController { @IBOutlet weak var txtFieldName: UITextField! @IBOutlet weak var txtFieldDescription: UITextField! @IBOutlet weak var txtFieldNotes: UITextField! @IBOutlet weak var switchCompleted: UISwitch! var viewModel = TodoViewModel(todo: nil) override func viewDidLoad() { super.viewDidLoad() store.selectedTodo.startWithValues { todos in let model = todos.first! self.txtFieldName.text = model.name ...Read now
Unlock full access