🍬
XRepository is based on QBRepository by QuickBirds Studios. It is lightweight implementation of Repository pattern in Swift.
Cornerstones of this project are protocol Repository
and class AnyRepository
as its generic implementation. Repository
supports basic and advanced CRUD operations. Also, you have access to out-of-the-box implementations of a few popular storages based on: BehaviorRelay
, RealmSwift
, FileManager
. But you can also create your own implementation of those ones or any other storage mechanism.
Since Repository
requires associated value to it, we use its abstract implementation AnyRepository
.
Usage is simple:
And some cool sugar 🍬:
XRepository is a pure implementation of Repository pattern. If you want to add RxSwift support to your repository, check super-lightweight extension: RxXRepository
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler. It is in early development, but Alamofire does support its use on supported platforms.
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/sashkopotapov/XRepository.git", .upToNextMinor(from: "1.2.0"))
]
This framework is created by Sashko Potapov.
XCoordinator is released under an MIT license. See License.md for more information.