Created
February 5, 2021 21:21
-
-
Save somersbmatthews/b739f1b92a4b6cfbefbc0fe50aba21e1 to your computer and use it in GitHub Desktop.
computed properties view extraction with swift #ios #swift #swiftui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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