Skip to content

Instantly share code, notes, and snippets.

@laevandus

laevandus/LaneListView.swift Secret

Created Mar 14, 2021
Embed
What would you like to do?
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