To display numbers in a list just use this code in ContentView.swift file
List(1...20, id: \.self) { index in
Text("\(index)")
}
Facebook Twitter Pinterest LinkedInTo display numbers in a list just use this code in ContentView.swift file This is the result in XCode: Facebook Twitter Pinterest LinkedIn
This is the result in XCode:
![](https://swiftprogramming.com/wp-content/uploads/2024/05/list-numbers-swiftui.jpg)
Leave a Reply