Swift version of Ray Wenderlich's iOS Design Patterns blog post.