Swift Playgrounds

RSS for tag

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

Swift Playgrounds Documentation

Post

Replies

Boosts

Views

Activity

CoreML in playgrounds
How do I add a already made CoreML model into my playground? I tried what people recommended online -- building a test project and get the .mlmodelc file and put that in the playground along with the autogenerated class for the model. However, I keep on getting so many errors. The errors: Unexpected duplicate tasks Target 'help' (project 'help') has write command with output /Users/cpulipaka/Library/Developer/Xcode/DerivedData/help-appuguzbduqvojfwkaxtnqkozecv/Build/Intermediates.noindex/Previews/help/Intermediates.noindex/help.build/Debug-iphonesimulator/help.build/adc7818afdf4ae03fd98cdd618954541.sb Target 'help' (project 'help') has write command with output /Users/cpulipaka/Library/Developer/Xcode/DerivedData/help-appuguzbduqvojfwkaxtnqkozecv/Build/Intermediates.noindex/Previews/help/Intermediates.noindex/help.build/Debug-iphonesimulator/help.build/adc7818afdf4ae03fd98cdd618954541.sb Unexpected duplicate tasks Showing Recent Issues Target 'help' (project 'help'): CoreMLModelCompile /Users/cpulipaka/Library/Developer/Xcode/DerivedData/help-appuguzbduqvojfwkaxtnqkozecv/Build/Intermediates.noindex/Previews/help/Products/Debug-iphonesimulator/help.app/ /Users/cpulipaka/Desktop/help.swiftpm/Resources/ZooClassifier.mlmodel Target 'help' (project 'help'): CoreMLModelCompile /Users/cpulipaka/Library/Developer/Xcode/DerivedData/help-appuguzbduqvojfwkaxtnqkozecv/Build/Intermediates.noindex/Previews/help/Products/Debug-iphonesimulator/help.app/ /Users/cpulipaka/Desktop/help.swiftpm/Resources/ZooClassifier.mlmodel ZooClassifier.mlmodel: No predominant language detected. Set COREML_CODEGEN_LANGUAGE to preferred language.
1
0
871
Feb ’24
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
713
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
706
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
531
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
394
Jul ’24
Playgrounds issue: Has to reload the puzzle every time we test code
Hi! I have a remote student who's learning to code in Swift using Playgrounds - Learn to Code 2. It's frustrating to try to test his code when we think he as part of a solution to a puzzle because he can't run his code twice in the same puzzle without resetting the puzzle - when he tries, the page gives an error, and he has to reload the whole puzzle, which erases his code. As a workaround, he's been copying his code and reloading the puzzle whenever he wants to test out a partial solution. Is there an easier way to do this?
0
0
207
Sep ’24