Created
July 2, 2020 13:31
-
-
Save stevencurtis/f4eee9cf320a8d1b0f4f0989c2d7bf36 to your computer and use it in GitHub Desktop.
swiftuilist
This file contains 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 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