I'm working with the VIPER architecture in my app, now I want to use my realm database. However, normally I would put it in AppDelegate
, if I then would want to use it in the ListInteractor
, I need to import UIKit
which is against VIPER rules.
How could I solve this nicely? I've considered the following options:
- Creating a service
- A singleton solution
- Just using
import RealmSwift
in the interactor, however, I would lose easy migration functionality.
I do want to be able to keep migrations as easy as possible, as well as other configs.