Hi,
I am looking for opinions on the best way to handle a problem I'm having.
My client wants his app to show a list of math tables, such as 1+1 = 2, 2+2 = 4, and so on. I have a list view with said tables in an array, which I manually have to input in. He wants the list to go from 1 to 20.
I'd assume that I would need some sort of for....next loop, but how would I show that in a list?
Thanks for any help you can give.
This is what I have so far:
I am looking for opinions on the best way to handle a problem I'm having.
My client wants his app to show a list of math tables, such as 1+1 = 2, 2+2 = 4, and so on. I have a list view with said tables in an array, which I manually have to input in. He wants the list to go from 1 to 20.
I'd assume that I would need some sort of for....next loop, but how would I show that in a list?
Thanks for any help you can give.
This is what I have so far:
Code Block import SwiftUI import UIKit struct ATables: View { var tables = ["Temporary","1 + 1 = 2","2 + 2 = 4"] var body: some View { NavigationView { List { ForEach(self.tables, id: \.self) { show in HStack { Image(systemName: "arrow.right") .resizable() .frame(width: 30, height: 20, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) Text(show) .font(.custom("Chalkboard", size: 50)) } } }.navigationBarTitle(Text("Addition Tables (1 - 20)")) .navigationBarTitleDisplayMode(.inline) } } struct ATables_Previews: PreviewProvider { static var previews: some View { ATables() } } }