Skip to main content

SWIFT / Swift Playground App

I installed the iOS 10 Beta on my iPad today and just like mentioned at WWDC 2016, with iOS 10 we now have a NEW app called "Swift Playground" that allows users to start digging into programming in Apple Swift language.

When I first saw the presentation about "Swift Playground app for iOS 10", I was totally mind blown. That is exactly what I have been asking for many years. A good coding app on iPad.

Well, actually we are already able to do some coding on iPad and iPhone using 3rd party apps like Pythonista and Procoding (Processing, Python, etc). But now, we finally got the Apple official coding app built in for iPad.

The app is using Swift iOS programming language, and Swift is a kind of nice blend of Python, Lua, and few other high level programming languages.

Heard that many programmers are liking Swift, which is a good sign!

FIRST TEST SWIFT PLAYGROUND

Swift Playground app comes with some tutorials and I guess anyone will definitely start from here. Step by step beginner tutorial is always good fun.

Each tutorial needs to be downloaded before it can be loaded. So give it some time to load the program from the net and once it is completed, you are good to go.

The first coding tutorial for Swift is really colorful with cute character we can control using code. The tutorial will feel slow for intermediate programmer, but anyhow, it is worth checking.

It starts from the very basic of running premade functions (COMMANDS) to move and orient a character on screen in it's environment. Then it goes into creating custom function.

func () {

}

Then goes into concept of LOOP in Swift and so on, each with example puzzle to solve.

for i in 1...4 {

}

Experience programmers can certainly go through each puzzle real quick, but what is fun is to actually make mistake and try things or variety of solutions. By doing so, you will learn the Swift syntax.

It comes to my surprise that the provided puzzle and examples goes pretty far and working out our logic. Even though basics, it will start to get into more interesting areas. Apple has made one really good programming tutorial available on every iPad running iOS 10 and this is fantastic!

FURTHER ON...

As you go along the Swift Tutorial App, you will discover that soon you started to think all kind of programming logic, even using few simple tools such as:
  • Functions
  • For Loops
  • Conditional If, If Else, Else
  • NOT, OR, and AND operators
  • While Loops

The last few levels will give more challenge. Beginner and experience programmers could find joy in going through this example for sure.

This is only the beginning, but I think I started to like Swift, thanks to the Playground app!


Comments

Popular posts from this blog

PYTHON / OpenCV, Recreate Uncanny Manga - Anime Style

Can you tell what it is? Computer Vision. Yesterday, I spend almost whole day exploring this opencv module using Python. What I discovered was revealing. Even at the very basic level, I could produce some interesting Image and Video manipulation using all the code collected from documentation and many, many blog tutorials. If you are a total noob like me, I am still getting used to knowing that the CV in OpenCV means Computer Vision! Actuallly, I recalled that I did try to get into OpenCV few years back ago, when I knew no Python and when Python opencv module was probably still early. It was all C++ code and it was a little bit too hard for me. I read a couple of books about opencv at the library, I did not understand a single thing. That was back then. Today, for strange reason, with a bit of knowledge of Python, I can go a little further. EDGE DETECT IN OPENCV Me holding you know what. What leads me this far is my curiosity on how we can replicate Wolfram Langu...

music21 / MIDI and Python

If you like to generate music with Python, the last time I checked, we have module for ChucK and also for Pi Sonic. They both require server to talk to Python, there might be slight latency and delay, but they are quite fun and easy to setup. And... there is also this fully Python module that deals with music: (a bit hard to use I found) http://ajaxsoundstudio.com/software/pyo/ I like the idea of being able to generate music on the fly via Python. Would be nice if realtime, and if I could connect it to ... Blender 3D for example. Anyhow, I remember apart from SYNTH there is also MIDI, and maybe Music Generation does not have to be realtime, if we can code certain BEAT and TRIGGER to match the animation or sampling of other stuff that we can visualize. PYTHON AND MIDI By some kind of magic I actually stumbled into this 'music21' module for Python. http://web.mit.edu/music21/doc/about/what.html I look through this 'music21' quickly and found lots of interesti...

Python for Kids -- for Adult. Coding can be fun, give it a try.

Stumbled into this book at local library, amongst many others. Python coding examples in this book are really fun and the illustrations are great! Kids nowadays are so lucky (!). Adults with some spare time should enjoy this too! (hopefully). BOOK: Computer Coding Python Projects For Kids by Carol Vorderman https://www.amazon.com/Computer-Coding-Python-Projects-Step/dp/0241286867#:~:text=Book%20overview&text=Computer%20Coding%20Python%20for%20Kids%20uses%20a%20hands%2Don%20approach,have%20fun%20as%20they%20learn. Sometimes we make assumption that if one has access to library, Internet, or a great amount of knowledge,  then they will automatically be aspired to learn and discover more. Well, not always the case! Not everyone will be interesting to code after all. Even if everyone can code. Even as a geek, I think it takes a bit of some brain coordination and spare some time to find the one you most interested in and then really dig into it, to actually learn and have some tinker...