قالب وردپرس درنا توس
Home / IOS Development / ios – Cannot preview this file – [App Name] .app may have crashed on Xcode 11 Beta 5

ios – Cannot preview this file – [App Name] .app may have crashed on Xcode 11 Beta 5



The Xcode preview does not work if I add a EnviromentObject wrapper. Every time I add a canvas does not build and I get this error:

Can't preview in this file – [App Name] .app may have crashed

If I replace EnviromentObject property pack with ObservedObject and initialize that everything works fine.

Here is my code:

  class NetworkManager: ObservableObject {

}

struct ContentView: View {
@EnvelopeObject was networkManager: NetworkManager

was body: some show {
Text ("Canvas does not work")
}
}

# if DEBUG
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView (). EnvironmentObject (Network ())
}
}
# finally about


Source link