Your Second iOS & SwiftUI App, Episode 21: ForEach | Kodeco

A List is not only for displaying a collection of similar views. That’s the job of ForEach! Employ them both in order to have more complex columns.


This is a companion discussion topic for the original entry at https://www.kodeco.com/25836622-your-second-ios-swiftui-app/lessons/21

Thanks for the great course! Quick question:

Is there something special about the modifier, buttonStyle(_: ) that forces the List to center the button in its row?

Specifically in the video 2:40 minutes you mention instead of using an HStack we could use buttonStyle modifier. Forgive me if this is too naive but the documentation for the modifier isn’t helpful.