The keyword guard has been introduced in Swift 2. It was a little bit inconspicuous at the first sight, but it has a lot of power. In this article we will take a look at three uses cases for guard.
Tag: Swift
Swift: Public Properties With Private Setters
In Swift you can easily create public properties with private setters. It makes your code much safer and shorter.
Swift 3 And Beyond
On December 3, 2015, the Swift language was released as open source. It also involves a roadmap for Swift 3, which will be released in fall 2016.
The Pyramid Of Doom In Swift
If you are using a lot of nested indentations, your code becomes rapidly unclear – the pyramid of doom. You can avoid this by using the keyword guard.
Swift: weak and unowned
With the keywords weak and unowned you can avoid so-called reference cycles. In this post we will discuss the differences between them.
Should You Migrate Objective-C Code To Swift?
The future belongs to Swift, but does this mean that you should migrate Objective-C code to Swift?
Swift: map and flatMap
With the functions map and flatMap you can easily transform an array into a new one.
A Trick To Discover Retain Cycles
Although ARC does most of the memory handling work for you, your app can still suffer from so-called retain cycles. So it is very important to discover them.
Swift Tutorial For Beginners: Part 1
Swift is Apple’s new programming language for developing applications for iOS, watchOS, tvOS and Mac OS. In this Swift tutorial you will learn all its basics.
Swift: Using Local Closures
Closures are often used as function arguments. But sometimes there are situations where local closures can be very handy.