iOS Examples

Swift

This snippet provides an extension for the Swift array to get random elements and shuffle the order of the elements.
How to use the Swift range syntax (0...5) for enums and other types that represent continuous values.
Use Key-Value Observing to get notified when properties of an object change.

UIKit

This tutorial will show you how to configure table contents using the Storyboard and programmatically, how to present data from Swift Arrays and how to make a table reorderable.
How to quickly implement a choice of a value from a UITableViewController that is presented as popover.
The UIKit example code snippets can be inserted into a Xcode Playground to experiment with UIKit view controls.
Generate Swift UIColor code by RGB or hex value using this Photoshop-like color picker.

Auto Layout

This snippet describes how to use auto layout constraints to resize cell views according to their content.
This snippet shows how correctly setup a UIScrollView in a Storyboard using Auto Layout constraints.

Networking

Example code how to download images in the background.
This snippet demonstrates how to use URLSessionDownloadTask to download files in background so that they can completed even if the app is terminated.
Use NSURLComponents to encode HTTP GET parameters.
This tutorial shows how to use the Multipeer Connectivity framework to communicate between iOS devices.

Xcode

Ralf Ebert Ralf Ebert is an independent software developer and trainer for Mac OS X and iOS. He makes the Page Layers and Straight ahead apps and conducts iOS trainings in Germany since 2009.