Treehouse Intermediate Course - Part 8 (Generics 6)
So the sixth and final part on generics! It's been tough but I've accepted that it's all part of learning Swift at a deeper level, rather than learning specific code for particular projects! Let's do this! Start Time - 15:46 So creating a couple of protocols - linked to views and data. By specifying a protocol as the type, we can specify any type that conforms to that protocol. So errors are coming up. Here's Pasan's code - protocol DataProvider { associatedtype Object func object(atIndex index: Int ) -> Object } protocol ConfigurableView { associatedtype Data func configure(with data: Data ) } class ViewController<View: ConfigurableView , DataSource: DataProvider > { let view: View let data: DataSource init ...