From the course: iOS App Development: Design Patterns for Mobile Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Protocol injection

Protocol injection

From the course: iOS App Development: Design Patterns for Mobile Architecture

Start my 1-month free trial

Protocol injection

- [Instructor] So we've move all the logic from the view controller into its other layers. And we've worked on this dependency registry to inject these things, but we're still tied to concrete implementation details for each of these layers and for the presenters. And ideally we would just have an interface or protocol that each of these conforms to. So let's go ahead and start doing that. Start at the data layer. And for each of these, I'm going to call these impl. There's not a lot of good naming conventions for protocols yet within Swift. I'll let you and your team decide what's best for you, but right now I'm just going to call it impl to make it clear that this is the actual implementation versus the data layer is more abstract. For this we just want to expose a couple of methods. One of them is the save method. Let's go ahead and just pull away that panel. And the other one is that load from DB method. We also want to make sure that the extensions also hae impl in place. Both of…

Contents