A Swift Kickstart
January 24, 2018
This best-selling, one-day, intensive class introduces you to the essential aspects of the latest version of the Swift Programming Language.
We begin the day with a simple iOS sample project and quickly move to a hands-on exploration of Swift functions, variables and constants, and collections. You'll be introduced to optionals and other Swift essentials.
During the second part of the class you will investigate Swift types as you create and use instances of Swift classes, structs, and enumerations. You'll experiment with methods, subclasses and properties and learn to harness the power of polymorphism through protocols and protocol extensions. We finish the day with another iOS project that uses much of what you learned to create a simple MVVM project.
January 25 & 26, 2018
Day 1: Patterns in Using Swift
Our focus for the first day day will be on types and communication.
In the first half we create a family of types for Currency and use Phantom Types, Nested Types, Protocols, Protocol Extensions, and Generics to ensure they work properly with each other. We also introduce elements that allow you to write literate code that is easy to read and use safely. We end this section with custom operators you will adopt and use in your everyday Swift development.
In the second half we focus on how Swift changes the way you architect your apps. We move from MVC to MVVM in two settings and see how working with value types changes some of your standard practices. In the first example, we partition behavior into discrete parts and limit their knowledge and dependencies. We focus on reducing the surface area of the API we work with. In the second part we build a generic model and use it in a simple Table View application where the data source is not the Table view controller.
Day 2: Map, Filter, Reduce, and FlatMap
The second day of the workshop will take you from a casual developer who uses map() now and then in your code to someone who can create and use Functors and Monads at will.
In the first half of the day we start with higher order functions and look at use the map, filter, reduce, and flatmap that are part of the Swift Standard Library.
In the second half we look at the shape of map and flat map and write our own versions to reduce the code needed to work with types that we create. We will end the day by creating a State type that we can use to obtain a result and the transformed State. You’ll find that this technique applies to much of the code you write and it makes your code more testable.