What's the difference

I have a few questions about the Swift Student Challenge development tools. What is the difference between swift playground and Xcode playground? Also, is it possible to develop vision OS in the playground?

Replies

The challenge requires you to submit an app playground (.swiftpm). Both Xcode and the Swift Playgrounds app can create that type of playground. As to the difference, the most obvious one is that Xcode requires a Mac, so if you only have an iPad then you have to use Swift Playgrounds. If you have a Mac, where both options are available, my general advice is to use whichever tool you’re most comfortable with. Xcode has more features, but that also makes it more complicated.

Also, is it possible to develop vision OS in the playground?

To enter that in the challenge? No. The platform requirements are covered by that same Swift Student Challenge > Eligibility page.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Edit: I started writing this some time ago and haven't seen Eskimo's reply, which is very straightforward and easy to understand :). Mine emphasizes the same points.

What is the difference between swift playground and Xcode playground?

First of all, for the challenge, you need to create a Swift Playgrounds App (.swiftpm) also known as "App Playground", and you can make it either in Swift Playgrounds or Xcode. Here is a thread that can help you choose the right thing in Playgrounds / Xcode.

Xcode playgrounds (File > New > Playground) are Swift testing environments in which you can write code rapidly, seeing results instantly (kind of like a REPL; you can't really build apps with them but they're great for prototyping). However, for the Swift Student Challenge, you need to make an App Playground, not an Xcode Playground / Swift Playground Book, as explained in the thread I previously mentioned.

Also, is it possible to develop vision OS in the playground?

I don't think you can make visionOS apps in App Playgrounds today (in either Xcode or Swift Playgrounds), but iPad apps can usually be easily converted to functional visionOS Apps, so you could run these with minimal changes once you "port" your app into an Xcode project. This would be outside the scope of the challenge (but still a fun learning exercise!).

If you're wondering about the differences between Swift Playgrounds and Xcode

There are a number of differences between Xcode and Swift Playgrounds (the apps you will use to code your app). Xcode is usually more advanced, having more features and being widely-used by professional developers. Swift Playgounds, however, is designed for new learners, but App Playgrounds are really powerful, allowing you to create and publish apps for iPhone, iPad and Mac (with Mac Catalyst) directly from an iPad!

From my experience both work quite well, and Swift Playgrounds doesn't really miss out on much when developing App Playgrounds! It has a simple, elegant interface and works well, so if you're starting your learning journey this could be the best choice (though I guess you could start with Xcode as well). In Xcode you can choose multiple run targets (iPad simulator, iPhone simulator, Mac app etc.), but Playgrounds take care of that for you and you don't have to install additional simulators.

Also, I believe Swift Playgrounds is a much lighter app (takes less space and less time to install). Xcode, however, takes up a bit more space, and you'll need to install simulators as well.

If you already used Xcode / have some programming experience you could go ahead and use it, as this will help you familiarize yourself with it, and you can also start directly with Xcode, but Swift Playgrounds will essentially do the same job in most cases. Ultimately it's your preference. The App Playground you make will usually work on both Xcode and Swift Playgrounds (I think last year I couldn't run my app built with Xcode due to some differences in how Playgrounds handled ML resources, but this doesn't happen often) on macOS. When switching from iPad to Mac and vice versa you might encounter some platform differences - such as stuff that isn't supported in Catalyst.

  • Thanks for filling in the gaps here!

  • Well I don't think there were any gaps, but no worries :)

Add a Comment