John Sundell highlights one type of situation that can occur when dealing with generics in Swift, and how I usually solve it using a type erasuretechnique based on closures.
When you are developing apps using the OOP paradigm, you will realize that, if you want to be able to test the software, you need to use IoC principle. Usually, to achieve this we use the dependency injection pattern which consists of providing each class with the dependencies it needs.
Swift is not a functional programming language. Pushing too hard to make it one fights Swift and breaks Cocoa. But Swift has absorbed some fantastic lessons from the functional world.