Help please

Ok in the main page, I put this these lines of Swift code.

import SwiftUI
import PlaygroundSupport


struct Preview: View {

    var body: some View {

        ProgressView()

    }

}





PlaygroundPage.current.setLiveView(Preview())


I then created a secondary page name ProgressView.Swift too learn how to use multiple pages And put this in it

import SwiftUI



public struct  ProgressView : View {

    

    public var body: some View {

        Text("hello")

    }

}


but every time I hit run I get this error message pop up
there was a problem in this playground check your code and try again
ProgressView() was introduced to iOS14 but I don’t think that calling you’re own view struct that name is the problem.

Try unchecking the Enable Results settings next to the run button. I find that this causes the problem with slow rendering and the Abort called messages, as it does say that it May reduce performance.
I do that now it says initializer is
inaccessible due to internal protection level
Accepted Answer
So which is ProgressView() ?

Yours ? System one ?

Did you try changing into

Code Block
public struct MyProgressView : View { }


And
Code Block
struct Preview: View {
var body: some View {
MyProgressView()
}
}


Hey BabyJ thanks for posting your tip. I couldn't get my Swift Playgrounds using SwiftUI that ran fine in v3.3 to run in v3.4. I'd just get vague errors.

To get my SwiftUI Playgrounds to run in Swift Playgrounds v3.4

On macOS:
Disable results

On iPadOS:
Click the speedometer and uncheck enable results
PlaygroundPage.current.wantsFullScreenLiveView = true wouldn't show full screen until I toggled show console

I'll submit a report via feedback assistant
Help please
 
 
Q