Post

Replies

Boosts

Views

Activity

Reply to Xcode preview crashes all the time
Hi Thank you all for your swift response and great suggestions. But I guess the problem isn't Xcode or the preview. I think it has something to do that I dont't pass the CoreData instance the right way. I tried once with the ".environment" but it didn't work. Does someone have an idea? @Environment(\.managedObjectContext) var moc static var previews: some View { AddListView() .environment(.managedObjectContext, DataController(name: "preview").container.viewContext)) } } This is how the crash looks like:
Jul ’23
Reply to NavigationLink issue
var body: some View {         NavigationView {             VStack {                                  Image(systemName: "cross.fill")                     .font(.system(size: 150))                     .foregroundColor(Color(.systemRed))                                                   Text("SOS")                     .font(.system(size: 40, weight: .bold))             }                                       .toolbar{                 ToolbarItemGroup(placement: .bottomBar) {                     Image(systemName: "cross.fill")                         .font(.system(size: 30.0))                         .foregroundColor(Color(.systemRed))                                                                   Spacer()                                          NavigationLink(destination: heartTextSquareView().navigationBarBackButtonHidden(true)) {                         Image(systemName: "heart.text.square")                             .font(.system(size: 30.0))                             .foregroundColor(Color(.systemRed))                          }                                                               Spacer()                                          NavigationLink(destination: keyView().navigationBarBackButtonHidden(true)) {                         Image (systemName: "key")                             .font(.system(size: 30.0))                             .foregroundColor(Color(.systemRed))                     }                                                               Spacer()                                          Image (systemName: "gearshape")                         .font(.system(size: 30))                         .foregroundColor(Color(.systemRed))                 }                              }                                                             }                       }
Dec ’21