Category Archives: Swift

Swift: Functional Paradigm

When Swift was introduced, it introduced not just a new programming language, but a number of new techniques. One of the most powerful Swift language feature is the ability to write code in more functional style. I took some time to learn functional programming at the end of 2015 so I can write better Swift … Continue reading Swift: Functional Paradigm

Swift: Phantom Types

Playing around Swift for some time and you might have encountered a bug or errors on your code by summing up or multiplying variables with different types. Well, not really just Swift but a lot of programming languages have the possibility to calculate variables of different types resulting to possible bugs and/or errors. Phantom Types … Continue reading Swift: Phantom Types

Swift is Open Source

First of all, let’s thank the people who contributed their meaningful time to the make the Swift programming language open source, so Thank you Apple and Thank you to the people who made this possible. 👏🏻 Swift is Open Source! 🎊🎉 “Today is the result of an amazing amount of work by dedicated and phenomenal … Continue reading Swift is Open Source

Swift 2.0

With the WWDC 2015 came many improvements with Swift — not just making writing code much more beautiful, but also better error handling, and new optimisations that will make your app run even faster. Back to Basics So Swift 2.0 is here with a lot of new features. If you already completed the Swift programming … Continue reading Swift 2.0

Swift: JSON Parsing

JavaScript Object Notation. JSON, pronounced (/ˈdʒeɪsən/ jay-sən), is an easy standard to parse in client-server application data. It is easy to implement and simple to understand. With the release of iOS 5 back in 2011, the NSJSONSerialization class was added in the SDK, which gives an easy to use delegate method to parse JSON data. … Continue reading Swift: JSON Parsing

Swift: Protocols

In Objective-C, you are allowed to define protocols which declare the methods expected to be used for a particular situation. In Swift, protocols are basically a named contract that your types should conform to. If your type says it conforms to Equatable, then it better fulfil all of the required methods to make it equatable. … Continue reading Swift: Protocols

Swift: Operator Declaration

The Swift standard library defines a number of operators, many of which are available to most programming languages. The most familiar operators that will come to mind are the MDAS operators’ *, /, +, – respectively. Operators such as these are very simple to use and remember that it was thought ever since we were … Continue reading Swift: Operator Declaration

Swift: Range Operators

Swift includes two range operators, closed range and half-closed range, which are shortcuts for expressing a range of values. Range operators are most commonly used with the for loop. In Objective-C, we have 2 different for loops, the traditional loop and iteration-based loop. Traditional For Loop The traditional for loop found in C requires 3 … Continue reading Swift: Range Operators