During this one-day advanced Swift workshop, you will learn when, where, how, and why to apply aspects of functional programming to your Swift code.
- Drive your use of Swift forward with an advanced understanding of functional programming -
Join Daniel Steinberg, author of A Swift Kickstart and Developing iOS 7 Apps for iPad and iPhone, as he provides an in-depth insight into functional programming using Swift. First off, you will develop your understanding of functions that consume other functions before moving on to situations where you might use functions where you would traditionally reach for a class. You will learn some of the key ideas of category theory that are useful to you as a programmer before finishing the day by looking at three key patterns that you have encountered in the Swift Standard library and can now incorporate into your code: map, flatMap, and apply.
Who you will be sitting next to
Developers already coding in Swift who would like to learn how and when to apply functional programming to their Swift toolbox.
How to apply these skills
See significant improvements to your product development by developing your existing knowledge of functional programming in Swift and adding a raft of new skills and concepts to your toolbelt.
Book early to receive a discount on the course price and in doing so you will not only commit to growing your own skillset, but help us grow our community of over 140,000 passionate techies.
Learn how to:
- Use functions where you might traditionally reach for a class
- Incorporate map, flatMap and apply into your code
- Understand key aspects of Functional Programming and add powerful tools to your toolbox
- Create higher-order functions using examples that are familiar to iOS developers
- Find the balance between map() and flatMap() and how to define them in the case of sequences and optionals
Prologue: The Day Ahead
- We have quite a day planned. In this brief introduction, we set the stage for what you'll be learning and how it will fit together.
Part One: Higher Order Functions
- You know that you can store functions in variables and pass them around like you would Strings, Ints, or Arrays. There are also functions that accept these functions as input or that return other functions as output. We begin the day by using and creating these higher-order functions using examples that are familiar to iOS developers.
Part Two: First Class Functions
- We think of functions as specifying behavior but they can often provide everything you might want from a class or a struct. Capture their type with a type alias and you might forget that you're working with functions. We'll look at concrete examples of how you might do this.
Interlude: (Very) Basic Category Theory
- It's become very popular to include concepts and phrases from Category Theory in talks on functional programming. We'll take a few minutes out of our day to look at some of the most important concepts so that we can refer back to them in the next two sections.
Part Three: Map and Functors
- Everyone knows the map() function that defined for Arrays and other Sequence types. We'll look at what is common between it and the map() for Optionals and then create a few map() functions of our own to see that it's essentially a design pattern.
Part Four: FlatMap and Monads
- Swift also defines flatMap() for sequences and optionals. We'll look at the difference between map() and flatMap() and see what is the same in the declaration for sequences and optionals and then create some flatMaps() of our own.
Part Five: Applicatives and Monoids
- Sometimes a map() function isn't enough and a flatMap() is too much. We'll find the balance with applicatives and look at how we might define them in the case of sequences and optionals. We'll look at the requirements and benefits of using this type of function.
Epilogue: A Look Back
- Whether you're heading for home or to the pub, you'll need a moment to collect yourself and arrange everything you learned today. We'll pull everything together and see how the pieces fit and answer any last-minute questions.
This course is for anyone who is already coding in Swift, and would like to learn how and when to apply functional programming to their Swift toolbox.
You should be an experienced developer who is familiar with Swift syntax.
Bring your own hardware
To take part in this workshop you are required to bring a Mac running the latest version of Xcode.