Generic Swift: It Isn’t Supposed to Hurt – Rob Napier

They said Swift is “protocol oriented,” so you wrote protocols. But you wanted them to be generic, so you added associated types. But your collections broke, so you added type-erasers. But your “as”-casts broke, so you switched to Any. But then everything broke, so you read about Mirror. And the tears began. Why did it have to be so hard to make an array?

It doesn’t have to be so hard. But it’s very easy to use the wrong tools to solve the wrong problems. In this session I’ll help you reevaluate what it means to write generic Swift and how to choose the right tools for the job. Whether your goal is reusable view controllers, flexible networking, data-driven UI, effective unit testing, or just the joy of elegant data structures, you’ll learn how to work with Swift and not fight the compiler.


Rob Napier

Rob is co-author of iOS Programming Pushing the Limits. Before coming to Cocoa, he made his living sneaking into Chinese facilities in broad daylight. Later he became a Mac developer for Dell. It's not clear which was the stranger choice. He has a passion for the fiddly bits below the surface, like networking, performance, security, and text layout. He asks "but is it good Swift?" a lot.