Playground

Pong like game as iPad SWIFT Playground


Last week on WWDC Apple showed a short demo about a Swift Playground for iOS, which was part of iOS 10 on iPads. They focused on using playgrounds to teach kids and students coding. That seems a little bit unspectacular and is a great understatement. Swift Playground support a lot of advanced iOS libraries like SpriteKit, SceneKit, UIKit

I was wondering if this can really replace a Mac with XCode to develop for my favorite platform. In fact I’m dreaming about only carrying my iPad with me and develop directly on an iPad.

 

So here we are: My first game SWIFT Playground completely written  on an iPad: Pong (updated for iOS 10 Beta 5)

 

1. Open the Playground App on your iPad:

PlaygroundLogo

2. Create a new SWIFT Playground:

IMG_2575iPad Create a new Playground

 

3. Here is the SourceCode. Just copy it in your playground and hit start. I’ll not introduce the basics of SpriteKit. You can check my other posts to get an introduction.

 

You can also download the sample directly from my GitHub repository.

PongPlayground

My personal conclusion: You can really write advanced Playground Apps completely on your iPad. The editor offers some intelligent solutions to choose the next needed code snippet without typing, but for bigger projects an external keypad improves the coding experience a lot. A possibility to upload the playgrounds as an App to the AppStore is missing. So a kind of Swift Playground Store would be nice for the future. Maybe this will come with the final release of iOS 10.

 

That’s all for today.

If you want to support me, please download my Apps from the Apple AppStore.

AppStore Stefan

Cheers,
Stefan 

 

Game Development
Game Center Integration
iOS
Quick Tip: Integrate iAd banners in your iOS App with two lines of code
AdSense and Admob
Quick Tip: Combine iAd and AdMob Ads for iOS in SWIFT