Showing posts with label Playgrounds. Show all posts
Showing posts with label Playgrounds. Show all posts

Wednesday, October 5, 2016

How to use the Swift Playgrounds iPad app to code on the go



Image: Apple
Swift Playgrounds is an easy way to learn Swift programming and to test code inside of Xcode, and now the feature is available for iOS 10. Learn how to use the Swift Playgrounds app for iPad.

By Cory Bohon | October 4, 2016, 8:13 AM PST


Apple announced Swift Playgrounds earlier this year during WWDC '16, andreleased it alongside iOS 10 in September. This new app is great for beginner coders and professional developers, because it allows you to officially write Swift code and have it run on the iPad. This is a first for iOS—Apple has never allowed apps that can compile or interpret code.

Perhaps the biggest feature of the Swift Playgrounds app for iOS is the ability to download tutorial projects to learn Swift; these projects are pretty self-explanatory so I won't cover them. I'll walk you through the workings of Swift Playgrounds, and how to write own code inside the app.

SEE: Apple's Swift programming language: The smart person's guide
What is a Playground?

Swift is Apple's newest programming language, and it can be used to write apps on all of its platforms: iOS, macOS, tvOS, and watchOS.


More about Mobility
8 reasons why professionals should get the iPhone 7
Report: Your business is wasting money on BYOD reimbursements
iOS 10 and the enterprise
Subscribe to TechRepublic's Mobile Enterprise newsletter

Playgrounds are a feature of Swift and the Xcode IDE that allows for quick compiles in a REPL (read-eval-print-loop) style interface, mimicking the REPL found in run-time interpreted languages like Ruby. Playgrounds are simple files that contain Swift code and can be compiled and run quickly, providing output logging to the user as the code is executed.

For example, if you write a for loop that iterates over an array to add new items, then for each iteration of this for loop, the playground will show the index of the loop and the output of the code executed in that loop. In this scenario, it would
Related Posts Plugin for WordPress, Blogger...