Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created March 14, 2021 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/3e15c66ccccfd57a0bf00385eb37c87f to your computer and use it in GitHub Desktop.
Save laevandus/3e15c66ccccfd57a0bf00385eb37c87f to your computer and use it in GitHub Desktop.
struct LaneListView: View {
@StateObject var viewModel: ViewModel
var body: some View {
List {
ForEach(viewModel.lanes) { lane in
LaneRowView(lane: lane)
}
}
.frame(minWidth: 200, minHeight: 200)
}
final class ViewModel: ObservableObject {
let lanes: [Lane]
init(document: FastfileDocument) {
lanes = document.lanes()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment