Post

Replies

Boosts

Views

Created

SwiftUI Alert in Previews is not shown
import SwiftUI struct Alerts: View { var body: some View { Text("Where is the Alert?") .alert(isPresented: .constant(true)) { Alert(title: Text("Hello"), message: Text("World")) } } } struct Alerts_Previews: PreviewProvider { static var previews: some View { Alerts() } } does not show the alert, only shows text. Live preview fails to start with message: The application "App" may have exited. Try again or make another change to your code. We also use previews for test to render previews for snapshots and we are unable to render Alerts.
4
1
2.9k
May ’21
SwiftUI Alert in Previews is not shown
import SwiftUI struct Alerts: View { var body: some View { Text("Where is the Alert?") .alert(isPresented: .constant(true)) { Alert(title: Text("Hello"), message: Text("World")) } } } struct Alerts_Previews: PreviewProvider { static var previews: some View { Alerts() } } does not show the alert, only shows text. Live preview fails to start with message: The application "App" may have exited. Try again or make another change to your code. We also use previews for test to render previews for snapshots and we are unable to render Alerts.
Replies
4
Boosts
1
Views
2.9k
Activity
May ’21