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

Posts under Swift Playground subtopic

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.9k
Jul ’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
834
Jun ’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
1.1k
Apr ’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
940
Mar ’24
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
1.3k
Feb ’24
Swift Student Challenge Vision
Hi Developers, I want to create a Vision app on Swift Playgrounds on iPad. However, Vision does not properly function on Swift Playgrounds on iPad or Xcode Playgrounds. The Vision code only works on a normal Xcode Project. SO can I submit my Swift Student Challenge 2024 Application as a normal Xcode Project rather than Xcode Playgrounds or Swift Playgrounds File. Thanks :)
7
0
1.9k
Feb ’24
Seeking Advice: Best Apple Laptop for Coding?
Hey Developers, I'm on the hunt for a new Apple laptop geared towards coding, and I'd love to tap into your collective wisdom. If you have recommendations or personal experiences with a specific model that excels in the coding realm, please share your insights. Looking for optimal performance and a seamless coding experience. Your input is gold – thanks a bunch!
2
1
6.2k
Feb ’24
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.
Replies
11
Boosts
2
Views
3.9k
Activity
Jul ’24
Is there any access to Swift Playgrounds on macOS12.3?
Is there any access to Swift Playgrounds on macOS12.3? On testflight or something?
Replies
1
Boosts
0
Views
583
Activity
Jul ’24
Swift Playgrounds warning when containing visionOS conditional code.
I'm getting the following error when previewing my Swift Playground package: Unrecognized platform name 'xrOS'; did you mean 'iOS'? Anyone know how to silence this? I don't have xrOS anywhere in my code so I'm guessing this is something with Swift Playgrounds or with the compiler.
Replies
2
Boosts
0
Views
1.5k
Activity
Jun ’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.
Replies
1
Boosts
0
Views
834
Activity
Jun ’24
beta version?
is there a beta version of Swift Playgrounds that supports the latest iPadOS 18 SDK, or do i have to use XCode on Mac?
Replies
1
Boosts
2
Views
1.1k
Activity
Jun ’24
SWIFT Playgrounds crashes on Mac and iPad
Hi, I want to learn SWIFT and started to use SWIFT Playgrounds 4.4 on iPad and MacBook Air. Unfortunately SWIFT Playgrounds unexpectedly crashes every 2nd to 3rd chapter I work on. I am currently trying to finish "Los gehts mit Code" and "Programmieren lernen 1". Is the app really so buggy, that it randomly crashes on executing the starting chapters ?
Replies
9
Boosts
1
Views
2.3k
Activity
Jun ’24
Xcode 14.2 - No output on the right side
My Mac is older one. I just started to learn Swift. I want to practice it. So I downloaded Xcode 14.2 for MacOS 12.7.4 (21H1123) On tutorials, it is showing live result. But for me nothing is happening. It is blank. How do I enable it?
Replies
1
Boosts
0
Views
795
Activity
May ’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.
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’24
Update Goal Instruction in Swift-UI Playgrounds Learn to Code 2
In Swift-UI Playgrounds Learn to Code 2 under the Chapter "Variables" and the exercise "Checking for Equal Values", there is no instruction to use the predefined variable numberOfSwitches in the goal instruction.
Replies
0
Boosts
0
Views
922
Activity
Apr ’24
Documentation
Does anyone know of any documentation for the various directives in the guidebook? Things like @GuideBook, @Guide, @Task, @SuccessMessage, etc. Thanks, David
Replies
1
Boosts
0
Views
1.2k
Activity
Mar ’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
Replies
2
Boosts
0
Views
940
Activity
Mar ’24
The output of the below code is different from what is anticipated
I was expecting all of the code to run in main thread, but both task and async function is working in backfround thread. Any explanations?
Replies
2
Boosts
0
Views
1.3k
Activity
Mar ’24
.playground to .swiftpm
I have made a swift playground with the .playground extension but the WWDC24 Swift Student Challenge says I have to submit a .swiftpm file. What do I do to convert it to .swiftpm?
Replies
2
Boosts
0
Views
1.1k
Activity
Feb ’24
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.
Replies
1
Boosts
0
Views
1.3k
Activity
Feb ’24
how to display loop times in playground
I want to get the loop times info in playground. But it seems to only display the latest result for a loop on the right side. Do I miss anything? Xcode 15.0.1 import Cocoa for i in 1...5{ print("\(i)") } I have a screenshot:
Replies
2
Boosts
0
Views
1.1k
Activity
Feb ’24
questions for WWDC Student Challenge
can i use AI scanning phone camera in WWDC Swift student challenge ?
Replies
1
Boosts
0
Views
741
Activity
Feb ’24
Var of type color inside swift data model
Hi, I am trying to create a variable of type Color inside the swift data model in Xcode playground . This gives me these errors : No exact matches in call to instance method 'setValue' No exact matches in call to instance method 'getValue' No exact matches in call to instance method 'setValue' What is the problem?
Replies
1
Boosts
0
Views
1.8k
Activity
Feb ’24
Swift Student Challenge Vision
Hi Developers, I want to create a Vision app on Swift Playgrounds on iPad. However, Vision does not properly function on Swift Playgrounds on iPad or Xcode Playgrounds. The Vision code only works on a normal Xcode Project. SO can I submit my Swift Student Challenge 2024 Application as a normal Xcode Project rather than Xcode Playgrounds or Swift Playgrounds File. Thanks :)
Replies
7
Boosts
0
Views
1.9k
Activity
Feb ’24
Swift Data and Core Data with playground
Can anyone tell me how to use Swift Data and Core Data with playground?
Replies
1
Boosts
0
Views
1.2k
Activity
Feb ’24
Seeking Advice: Best Apple Laptop for Coding?
Hey Developers, I'm on the hunt for a new Apple laptop geared towards coding, and I'd love to tap into your collective wisdom. If you have recommendations or personal experiences with a specific model that excels in the coding realm, please share your insights. Looking for optimal performance and a seamless coding experience. Your input is gold – thanks a bunch!
Replies
2
Boosts
1
Views
6.2k
Activity
Feb ’24