Skip to content

10Macit/Hover

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



apmCocoaPods compatible Carthage compatible Swift Package Manager compatible

Currently Available

Platform Version
iOS 13.0
tvOS 13.0
macOS 10.15
watchOS 6.0
macCatalyst 13.0

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.3"
end

Carthage Installation

github "onurhuseyincantay/Hover" ~> "1.0.3"

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

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 🧡

About

Async network layer with Combine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 87.7%
  • Ruby 11.3%
  • Objective-C 1.0%