Post

SwiftUI is a game changer

There is no doubt in my mind that SwiftUI is a complete game changer. This is all the code you need to define a UI that has:

  • A navigation controller
  • A table view
  • Cell configuration
  • Label font setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct ArticleListView: View {
    let articles: [Article]

    var body: some View {
        NavigationView {
            List(articles.identified(by: \.id)) { article in
                VStack(alignment: .leading) {
                    Text(article.title).font(.headline)
                    Text(article.preview).font(.subheadline)
                }
            }.navigationBarTitle(Text("Articles"))
        }
    }
}
This post is licensed under CC BY 4.0 by the author.