Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import SwiftUI
- import PlaygroundSupport
- struct Contact: Identifiable {
- // important for each to be unique
- var id = UUID()
- var name: String
- }
- struct MyTableView: View {
- let contacts: [Contact] = [
- Contact(name: "Matt"),
- Contact(name: "Andy"),
- Contact(name: "Hubert")
- ]
- var body: some View {
- List(contacts) { contact in
- Text(contact.name)
- }
- }
- }
- PlaygroundPage.current.liveView = UIHostingController(rootView: MyTableView())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement