Swift 2.0 – 2.B Open Source

WWDC 2015 had some interesting announcements and the biggest and most applicable / important announcement is that Swift is now 2.0 and going to be Open Source and be available for Linux. Since swift can be used for REPL, it could be used as an alternative for writing and executing scripts (on Linux type distros). […]

My Wishlist for Playgrounds

Apple Playgrounds are amazing and for those that are using it know how it works best for them. Some use it for algorithms, some for testing code, etc. One of the reasons that I think playgrounds is important is the integration. The integration of commentary and code that make it seem more like an interactive […]

Chaining cout in swift like C++

In an earlier article, we discussed the possibility of adding a cout like functionality in Swift as seen in C++ (http://swift.oz-apps.com/2015/04/using-a-cout/). There were a couple of impediments that prevented the full functionality of our cout function. Let us revisit that and add chaining

The ever changing nature of Swift and how to keep up with it

If you learned a language, that was it, you did not have to re-learn the same. There could have been additions or extensions to the language but it would not have changed. Welcome to the future, nothing is constant and nothing is static. Though Swift is a production release, ie. you can use it in […]

WIP: Use Swift Arrays like Lua Tables

This is work in progress and there are somethings that Swift cannot do where as Lua excels with them. Since everything in a Lua table is a reference or a pointer, you can recursively add table to refer to subtables. You could also store functions in the tables and invoke them based on the key. […]

Tip: Creating an Int from a String in Swift

Talking to a couple of developers over various mediums about Swift has had mixed results. However one thing that came up again and again was that it is a little confusing. While confusing in the literal sense would not be the correct word. So let me elaborate the issue first.

Using a cout << like function with Swift to work with console and String

If you have worked with C++, you might be well aware of the cout function, it is one of the most commonly used functions with C++. That is simply because you can just use it so

and it prints Hello World to the console. Well, using the println("Hello World") is not difficult either, but…

Creating a class from a string in Swift

One thing that Swift does not do very well is dynamism. That is because of the fact that it is a type safe language. So if you were to create a class from a classname i.e. a String, you would get different types of classes depending on the class name. So having a single variable […]

Tuples – holding multiple values in a variable

We saw that we can declare variables or constants to hold values that we could use in our code instead of hard-coding them. We could also return values from functions however in most languages you can only return a single value. Mainly this return value would be more like a Boolean value that indicated if […]