Skip to content
Async network layer with Combine
Swift Ruby Objective-C
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
Hover.xcodeproj
Hover
HoverTests
.gitignore
Hover.framework.zip
HoverKitSDK.podspec
License.md
README.md

README.md

Hover

apmCocoaPods compatible Carthage compatible

Currently for iOS 10.0 Above

Hover is a Network layer which uses Apple's new framework Combine and provides async network calls with different kind of request functions.

Cocoapods Installation

target 'MyApp' do
  pod 'HoverKitSDK', '~> 1.0'
end

Carthage Installation

github "onurhuseyincantay/Hover" ~> 1.0

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]? {
        ...
    }
 }

Request With Publisher

let provider = Hover()
let publisher = provider.request(
            with: UserTarget.login(email: "ohc3807@gmail.com", password: "123456")
            class: UserModel.self
        )
...
publisher.sink({ ... })

Request With Subscriber

let provider = Hover()
let userSubscriber = UserSubscriber()
provider.request(with: UserTarget.login(email: "ohc3807@gmail.com", password: "123456"), class: UserModel.self, subscriber: userSubscriber)

Tested with JsonPlaceholder Inspired By Moya Developed with 🧡

You can’t perform that action at this time.