Swift and SwiftUI tutorials for Swift Developers

How to display numbers in list in Swift programming language

To display numbers in a list with Swift just use this code in ContentView.swift file

 List(1...20, id: \.self) { index in
            
         Text("\(index)")
         
     }

To display numbers in a list with Swift just use this code in ContentView.swift file This is the…

This is the result in XCode:

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Article

How to use Section, List, header and footer in SwiftUI

Next Article

How to use Tab bar, TabView and tabItem in SwiftUI

Related Posts