Hover is a Network layer which uses Apple’s new framework Combine and provides async network calls with different kind of request functions.
Why and When to Use
The main benefit to use Hover is to abstract the networking layer as much as possible and remove redunant code from your projects as we know Apple announced a new framework called Combine the main goal is to provide a declarative Swift API for processing values over time. These values can represent many kinds of asynchronous events, so networking calls are the most important async events, which actually needs to have a support for Combine to prevent and integrate Apple’s native framework. Why you shouldnt use is when you dont have that much networking calls and also not so complex data flows to keep track on which means actually that you dont have states for the UI then dont use it. :)
Cocoapods Installation
target 'MyApp' do
pod 'HoverKitSDK', "~> 1.1"
end
Carthage Installation
github "onurhuseyincantay/Hover" ~> 1.1
Swift Package Manager Installation
Package
branch
Sample Usage
Provide Target
enum UserTarget {
case login(email: String, password: String)
}
extension UserTarget: NetworkTarget {
var path: String {
switch self {
...
}
var providerType: AuthProviderType {
...
}
var baseURL: URL {
...
}
var methodType: MethodType {
switch self {
...
}
}
var contentType: ContentType? {
switch self {
...
}
}
var workType: WorkType {
switch self {
...
}
}
var headers: [String : String]? {
...
}
}
Version 1.1
Currently Available
Hover is a Network layer which uses Apple’s new framework
Combine
and provides async network calls with different kind of request functions.Why and When to Use
The main benefit to use Hover is to abstract the networking layer as much as possible and remove redunant code from your projects as we know
Apple
announced a new framework calledCombine
the main goal is to provide a declarative Swift API for processing values over time. These values can represent many kinds of asynchronous events, so networking calls are the most important async events, which actually needs to have a support forCombine
to prevent and integrate Apple’s native framework. Why you shouldnt use is when you dont have that much networking calls and also not so complex data flows to keep track on which means actually that you dont have states for the UI then dont use it. :)Cocoapods Installation
Carthage Installation
Swift Package Manager Installation
Sample Usage
Provide Target
Request With Publisher
Request With Subscriber
Tested with JsonPlaceholder Inspired By Moya Developed with 🧡