Swift Playground

RSS for tag

Learn and explore coding in Swift through interactive learning experiences on the Swift Playground app for iPadOS and macOS.

Swift Playground Documentation

Post

Replies

Boosts

Views

Activity

Get Started with Apps Stuck in Playgrounds
The “Get Started with Apps” in Playgrounds looks great but it won’t allow me to advance to the next activity. It seems to think that my solution is incorrect, but what I did matches the solution provided in the “hint.” This could be corrected by either allowing for more variety in the responses, or by allowing the user to advance to the next activity regardless of whether the response they provided was correct.
11
2
3.6k
Dec ’21
"public headers ("include") directory path for 'Guide' is invalid or not contained in the target" error
Hi, I have a problem with making a swift playgrounds app walkthrough. I followed the steps exactly and modified my Package.swift a bit (in the targets section): .executableTarget(name: "App", dependencies: ["Guide"], path: "App"),         .target(             name: "Guide",             path: "Guide",             resources: [             .process("Guide.tutorial"),             ]) Now when I open the project in Playgrounds I get this error: public headers ("include") directory path for 'Guide' is invalid or not contained in the target Any help would be appreciated. Thanks
4
0
3.0k
Sep ’22
Playground can not create newbook / download sample playground after iCloud folder deletion, but it crashes
Hello All, I happen to remove "Playgrounds" folder from my iCloud drive, and afterwards Playground is no longer functioning but repeatedly crashes. It was okey before deletion, but now any operation to create or download playground then Playground App crashes all the time. Issue not resolved even creating same name folder by manual, Issue not resolved even re-install Playground - folder in iCloud will not created. I guess I need to fully uninstall PlayGround completely, then start from scratch to let Playground App to hold init step to generate required folder in iCloud, but not sure how to do it. Please give kind help if anyone knows about this issue, or if anyone knows complete deletion step of Playground. Best wishes, tons of thanks in advance. Best Regards, Issey Hamada
2
0
840
Mar ’24
Playgrounds
I've noticed Playgrounds crashing a lot lately, both on iPad and Mac. I have many Macs, Intel & M1, and 2 iPads, 7th Gen and 10.5" Pro. It's noticeably sluggish at the best of times progressively getting worse the last few updates, but worse than that it is hard crashing, losing data in the process. Anyone else seeing this? Not the end of the world, I'm a dev and use Xcode for anything substantial but I like to use Playgrounds on the iPad sometimes when I want to pop a quick idea down. I also plan to start creating playgrounds to help kids get into programming, so hoping this useful app isn't being neglected.
2
0
891
Apr ’24
How to access this REPL like tool used in a WWDC presentation?
I was watching this presentation about swift. A Swift Tour: Explore Swift’s features and design At timestamp 1:59, the presenter is using what looks sort of like swift playgrounds, however with a feature on the right hand side panel that is sort of like a REPL, and shows the value of an expression. How can I enable this feature? I am on the latest verison of Swift Playgrounds on macOS, and I cannot seem to find it.
1
0
706
Jun ’24
Swift Playgrounds BSActionErrorDomain error 1
I am writing an app in Swift Playgrounds 4.5.1 on an iPad 8th generation running iPad OS 17.5.1. When I click the run button I get the error “MyGame Crashed. Update failed. The operation couldn't be completed. (BSActionErrorDomain error 1.) MyGame may have crashed.” It was working up until a few days ago but now it can’t even show the preview. I haven’t updated the app or software since and I can run other app playgrounds. I have multiple nested views with multiple lists of buttons using ForEach statements and I am sharing variables across views using ObservableObject using code like this: class UserProgress: ObservableObject { @Published var score = 0 } struct InnerView: View { @ObservedObject var progress: UserProgress var body: some View { Button("Increase Score") { progress.score += 1 } } } struct ContentView: View { @StateObject var progress = UserProgress() var body: some View { VStack { Text("Your score is \(progress.score)") InnerView(progress: progress) } } }
2
2
631
Jul ’24