Ported theSwift example from _iOS 7 in Action_ to Swift and iOS 8