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

WOLFRAM / Making Text With Rainbow Color

Continuing with my Wolfram Mathematica Trial Experience... I watched and went through some more Mathematica introduction videos, read lots of Mathematica documentation and also going through the Wolfram Lab Online again a few times. There are some major learning curves and Mathematica is a lot different from normal programming language. Sometimes there is a lot of interesting "shortcuts", say like: FindFaces[] , WordCloud[] . Sometimes I got a little confused on how one can do iterations. Normally FOR LOOP concept is introduced early, but in Wolfram, because everything is EXPRESSIONS and ENTITY (like OBJECTS), sometimes it gets quite quirky. Mind you I am still in the first impression and having to look at many tutorials. Lots of NEAT EXAMPLES from documentation, but sometimes I got lost. I found Wolfram to be really awesome with LIST and generating list. It's almost too easy when it works visually. I cannot explain them with my own words yet, but there are ...

PYTHON PROCESSING / It only really begins ...

Back into Processing again, with Python! While Daniel Shiffman is continuously inspiring us with his CODING TRAIN series on YouTube, using Processing with Java and Javascript language, I decided to free my mind and trying to really do something using Processing and Python language. Installing Python language version on Processing 3 is easy enough, just first download the latest Processing and install the Python language mode via Add Mode button. Other link that might help: https://github.com/jdf/processing.py http://py.processing.org/tutorials/ BLANK MODE As soon as Processing Python Mode, opens up and running I am presented with a  blank environment. Suddenly I recalled my journey in learning programming from zero until now... With Python, outside Processing, commonly people will be introduced to Python IDE or IDLE environment. Something that looks like Console Window or Command Prompt, where we type single liners command. Python Command Line and IDE normally ha...

SONICPI / Ruby, Python, MIDI and OSC

I have a big curiosity on how we can use OSC or MIDI to send message from one app to another app, potentially to generate (realtime) synth sound, visualization, and animation. This is especially a fun area and environment when we wanted to use CODE for CREATIVITY. Sonic Pi (by Sam Aaron) is one app I really love to use when dealing with Synth and Sonic generator. I remember using ChucK in the past by Ge Wang, ChucK is also cool, but Sonic Pi is a lot more friendly. http://sonic-pi.net Sonic Pi multi-threaded ness and LIVE LOOP is really something new for me. But Sam made it easy enough so that we could generate "listener" very easily. MAKING SOUND WITH CODE There are plenty of ways we can "trigger" Sonic Pi to generate sound. Obviously we can just use the built in RUBY language inside Sonic Pi app. Fairly simple and fun language to use and you can generate some noise in no time! Sonic Pi RUBY language documentation is really in depth and a full on progr...