5.6. Second screen, part 2: Setting up Add Expense View Controller
//
// AddExpenseViewController.swift
// App5
//
// Created by Sakib Miazi on 5/18/23.
//
import UIKit
class AddExpenseViewController: UIViewController {
//MARK: initializing the ADDExpenseView...
let addExpenseScreen = AddExpenseView()
//MARK: set the current view to addExpenseScreen...
override func loadView() {
view = addExpenseScreen
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
Patching the PickerView to pick the type of expense
Defining static array 'types'

Adopting the Picker View's protocols
Housekeeping: Updating Navigation controller and patching Utilities.types in View Controller

Updating ViewController to use Utilities.types instead of the local array.
So far, the updated controller codes are as follows:
ViewController.swift
AddExpenseViewController.swift
Previous5.5. Second screen, part 1: Setting up the View of the Add Expense ScreenNext5.7. Second screen, part 3: Send new expense back to ViewController and update the TableView
Last updated