Getting the 4th element of an array in an array of arrays

I have a struct which creates an expense relating to a car. It has 5 items, (id, date, itemName, itemCost, and itemSpeedoReading). When created they are added to and array of expense items. I am trying to create an alert regarding the speedo reading. When a user adds a new speedo, I want to ensure it is greater than the speedo reading of the last expense item. At the moment I just have it set to > expenses.items.count.

Here is the expense item file. It has the struct which creates an ExpenseItem, and a class that adds these items to an Expenses array.

import Foundation

struct ExpenseItem: Identifiable, Codable {
    var id = UUID()
    let expenseDate: String
    let itemName: String
    let itemCost: Double
    let itemSpeedoReading: Int

class Expenses: ObservableObject {
    @Published var items = [ExpenseItem]() {
        didSet {
            if let encoded = try? JSONEncoder().encode(items) {
                UserDefaults.standard.set(encoded, forKey: "Items")
    init() {
        if let savedItems = "Items") {
            if let decodedItems = try? JSONDecoder().decode([ExpenseItem].self, from: savedItems) {
                items = decodedItems
        items = []

Here is the AddView1 file which adds a new expense. It is here that the user adds details of the expense including the speedo reading. It is this speedo reading that I want to ensure is greater than the speedo reading of the previous expense item.

import SwiftUI

struct AddView1: View {
    @ObservedObject var expenses: Expenses
    @State private var alertShowing: Bool = false
    @State private var expenseDate = ""
    @State private var itemName = "Fuel"
    @State private var itemCost = 0.0
    @State private var itemSpeedoReading = 0
    let types = ["Fuel", "Service", "Registration", "Insurance", "Other"]
    var body: some View {
        NavigationView {
            Form {
                Picker("Type", selection: $itemName) {
                    ForEach(types, id: \.self) {
                TextField("Cost:", value: $itemCost, format: .currency(code: "USD"))
                TextField("Speedo Reading:", value: $itemSpeedoReading, format: .number)
            .navigationTitle("Add an expense")
            .toolbar {
                Button("Save") {
                    if itemSpeedoReading > expenses.items.count {
                        let item1 = ExpenseItem(expenseDate: "", itemName: itemName, itemCost: itemCost, itemSpeedoReading: itemSpeedoReading)
                    } else {
                        alertShowing = true
            .alert(isPresented: $alertShowing) {
                Alert(title: Text("Please check the speedo!!"))

struct AddView1_Previews: PreviewProvider {
    static var previews: some View {
        AddView1(expenses: Expenses())

Any assistance is appreciated.