Repository Design Pattern in Swift

A clean way to query your models

What problem does it solve?

Sketching the scene.

Why do we need a repository?

Hello repository.

Handle all article interactions

Power-up: protocols

Power-up: Unit Testing

An example

Hello, dependency injection.

Super power-up: generics

1. Article repository

2. User Repository

That’s it.

Freelance iOS consultant. Currently helping out at Dutch Railways.