Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created July 2, 2020 13:31
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 stevencurtis/f4eee9cf320a8d1b0f4f0989c2d7bf36 to your computer and use it in GitHub Desktop.
Save stevencurtis/f4eee9cf320a8d1b0f4f0989c2d7bf36 to your computer and use it in GitHub Desktop.
swiftuilist
import UIKit
import PlaygroundSupport
import SwiftUI
struct ContentView: View {
let strings = ["1", "2", "3", "4", "5"]
var body: some View {
List(strings, id: \.self) { string in
Text(string)
}
}
}
let viewController = UIHostingController(rootView: ContentView())
PlaygroundPage.current.liveView = viewController
PlaygroundPage.current.needsIndefiniteExecution = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment