Created
January 8, 2021 10:30
-
-
Save timstudt/16b66d0f76c1018cebf2d5c5b3c67bc0 to your computer and use it in GitHub Desktop.
SwiftUI playground crash
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 SwiftUI | |
import PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
List { | |
ForEach((1...10).reversed(), id: \.self) { | |
Text("\($0)") | |
} | |
} | |
} | |
} | |
let content = ContentView() | |
_ = content.body // no crash | |
//PlaygroundPage.current.setLiveView(content) // signal SIGABRT. | |
//PlaygroundPage.current.setLiveView(ContentView()) // signal SIGABRT. | |
// from https://developer.apple.com/documentation/playgroundsupport/playgroundpage | |
//PlaygroundPage.current.setLiveView( // signal SIGABRT. | |
// List(0..<42) { number in | |
// Text("My favorite number is \(number).") | |
// } | |
//) | |
PlaygroundPage.current.setLiveView( // works | |
Text("Hello") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error: Playground execution aborted: error: Execution was interrupted, reason: signal SIGABRT.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.