Enabling Results in Swift Playgrounds causes app to crash

Hello, this is my first real Swift project, and I have ran into an issue. For some reason, when running my (WIP) project, having "Enable Results" set to on causes my project to not behave properly, run slowly, and eventually crash.

Some Notes:
  • Setting "Enable Results" to off fixes the issue completely, and I know that I could just put in a comment asking to disable it, but I am concerned that if the judges miss that then I will get disqualified

  • I am using the Swift Playgrounds App, not Xcode

  • I am aware that NavigationView does not work on the iPadOS version of Playgrounds, this is a macOS Playgrounds project

  • What happens when I run my project with "Enable Results" set to on is that the default view that is shown in the NavigationView is not shown and the app runs slowly. When you try to select one of the Sidebar Items, the project eventually shows the default view inside the NavigationView, and then crashes, showing the generic "There was a problem encountered while running this Playground. Please check your code for mistakes" error message.

  • I am 90% sure that the problem lies in the NavigationView, but I went ahead and put in the rest of my code in case the problem lies elsewhere

Any help would be extremely appreciated! Thanks!
Code Block
import SwiftUI
import PlaygroundSupport
struct mainView: View {
   
  var body: some View {
     
    navView()
     
  }
   
}
struct navView: View {
   
  @State private var selectedView: Int?
  var body: some View {
     
    ZStack(alignment: Alignment(horizontal: .center, vertical: .center)) {
       
      NavigationView {
         
        List {
           
          Section(header: Text("SplashScreen")) {
             
            NavigationLink("SplashInfo", destination: splashInfoDetailView(), tag: 0, selection: self.$selectedView)
            NavigationLink("SplashInfoContainer", destination: splashInfoContainerView(), tag: 1, selection: self.$selectedView)
            NavigationLink("SplashTitle", destination: splashTitleView(), tag: 2, selection: self.$selectedView)
            NavigationLink("SplashScreen", destination: splashScreenView(), tag: 3, selection: self.$selectedView)
             
          }
          .onAppear() {
            self.selectedView = 3
          }
        }
      } 
    }
  }
}
struct splashInfoDetailView: View {
   
  var title: String = "Test Title"
  var subTitle: String = "Test Subtitle"
  var imageName: String = "exclamationmark.triangle.fill"
  var body: some View {
     
    HStack(alignment: .center) {
       
      Image(systemName: imageName)
        .resizable()
        .aspectRatio(contentMode: .fit)
        .frame(width: 35, alignment: .center)
        .font(.largeTitle)
        .padding(10)
       
      VStack(alignment: .leading) {
        Text(title)
          .font(.headline)
        Text(subTitle)
          .font(.body)
         
      }
    }
  }
}
struct splashInfoContainerView: View {
   
  var body: some View {
     
    VStack(alignment: .leading) {
       
      splashInfoDetailView(title: "redacted", subTitle: "redacted", imageName: "swift")
      splashInfoDetailView(title: "redacted", subTitle: "redacted", imageName: "swift")
      splashInfoDetailView(title: "redacted", subTitle: "redacted", imageName: "swift")
      splashInfoDetailView(title: "redacted", subTitle: "redacted", imageName: "swift")
       
    }
    .padding(.horizontal)
  }
}
struct splashTitleView: View {
   
  var body: some View {
     
    VStack(alignment: .center) {
       
      Image(systemName: "swift")
        .resizable()
        .foregroundColor(.red)
        .aspectRatio(contentMode: .fit)
        .frame(width: 125, alignment: .center)
      Spacer(minLength: 15)
      Text("redacted")
        .font(.system(size: 27))
        .fontWeight(.black)
      Text("redacted")
        .font(.system(size: 27))
        .fontWeight(.black)
       
    }
  }
}
struct splashScreenView: View {
   
  var body: some View {
     
    ScrollView {
       
      VStack(alignment: .center) {
         
        Spacer(minLength: 20)
        splashTitleView()
        Spacer(minLength: 20)
        splashInfoContainerView()
        Spacer(minLength: 30)
         
      }
    }
  }
}
PlaygroundPage.current.setLiveView(mainView())

I don‘t think it‘s your code that is the issue. I‘m facing the exact same problem here, and I think that is rather a thing that Apple has to fix. There is a reason why below the toggle it warns you that you may experience lag.

On my playground, I have just put in a reminder that tells you to Disable Results before running.
I agree with @aminouled, I already had this problem and I solved It writing a note on the book part of the playground asking the jugdes to Disable Results before running
Ok thanks, I was just wondering if there was a way to fix it. I will just leave a (large) comment asking the judge to turn it off. Good Luck!
I guess you can disable results by modifying the manifest.plist with PlaygroundLoggingMode to Off. I don't know if it is accepted, could you anyone clarify if it is allowed to disable results with the above tag by default?

I actually had the same exact issue for my submission as well. What you need to do is set PlaygroundLoggingMode to Off.
  1. go to your playground book, right click, and click "show package contents"

  2. From there, navigate to this directory: Chapters --> "(Chapter name)".playgroundchapter --> Pages --> MyPlayground.playgroundpage

  3. Double click / open the file with Xcode "manifest".plist.

  4. If PlagroundLoggingMode under the key column is not present, then you need to add it.

  5. Set the value of PlaygroundLoggingMode to "Off".

Let me know if this helps or not. I can try to help you out later as well.

Enabling Results in Swift Playgrounds causes app to crash
 
 
Q