cell.textLabel?.text breaking if a number value is in an array

Hi the below array and code to output a list item works fine:

    var quotes = [
        [
            "quote": "I live you the more ...",
            "order": "1"
        ],
        [
            "quote": "There is nothing permanent ...",
            "order": "2"
        ],
        [
            "quote": "You cannot shake hands ...",
            "order": "3"
        ],
        [
            "quote": "Lord, make me an instrument...",
            "order": "4"
        ]
    ]
cell.textLabel?.text = quotes[indexPath.row]["quote"]

However if I change the "order" values to be numbers rather than text like below then for the above line I get an error message in Xcode "No exact matches in call to subscript". Please could someone tell me how to make it work with the numbers stored as numbers? (I'm wondering if creating an any array type and using the .text function has caused a conflict but I can't find how to resolve)

        [
            "quote": "I live you the more ...",
            "order": 1
        ],
        [
            "quote": "There is nothing permanent ...",
            "order": 2
        ],
        [
            "quote": "You cannot shake hands ...",
            "order": 3
        ],
        [
            "quote": "Lord, make me an instrument...",
            "order": 4
        ]
    ]

Thank you for any pointers :-)

This looks like a great choice for an array of tuples, and I'd create it like this:

var quotes: [(quote: String, order: Int)] = [
			("I live you the more ...", 1),
			("There is nothing permanent ...", 2),
			("You cannot shake hands ...", 3),
			("Lord, make me an instrument...", 4)
		]

		Text("\(quotes[0].order)")

And you can get the quote String by accessing quotes[0].quote.

For this task, it's best to define a dedicated data type. For example:

// Quote.swift

struct Quote {
    let order: Int
    let text: String
}

Next, create an array of quotes using this structure:

let quotes: [Quote] = [
    Quote(order: 1, text: "I love you more."),
    Quote(order: 2, text: "Nothing is permanent."),
]

Next, you can then access the array by index to retrieve a quote:

cell.textLabel?.text = quotes[indexPath.row].text

Also, I recommend you take a look at these resources:

cell.textLabel?.text breaking if a number value is in an array
 
 
Q