Skip to content

Instantly share code, notes, and snippets.

@somersbmatthews
Created February 5, 2021 21:21
Show Gist options
  • Save somersbmatthews/b739f1b92a4b6cfbefbc0fe50aba21e1 to your computer and use it in GitHub Desktop.
Save somersbmatthews/b739f1b92a4b6cfbefbc0fe50aba21e1 to your computer and use it in GitHub Desktop.
computed properties view extraction with swift #ios #swift #swiftui
import Foundation
import SwiftUI
struct PeopleView: View {
@ObservedObject var viewModel = PeopleModel()
var body: some View {
VStack {
ScrollView {
ForEach(viewModel.people) { person in
VStack(alignment: .leading) {
Text(person.name)
Text(person.twitterHandle
}
}
}
footerView
}
}
private var footerView: some View {
Text("footer view")
.padding()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment