Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ishkawa/APIKit
Type-safe networking abstraction layer that associates request type with response type.
https://github.com/ishkawa/APIKit
Last synced: 3 months ago
JSON representation
Type-safe networking abstraction layer that associates request type with response type.
- Host: GitHub
- URL: https://github.com/ishkawa/APIKit
- Owner: ishkawa
- License: mit
- Created: 2015-02-18T14:16:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T04:14:07.000Z (4 months ago)
- Last Synced: 2024-08-06T01:10:00.879Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 1.37 MB
- Stars: 1,991
- Watchers: 59
- Forks: 202
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ios - APIKit - A networking library for building type safe web API client in Swift. (Networking / Video)
- awesome-swift - APIKit - Library for building type-safe web API client. (Libs / Network)
- awesome-swift - APIKit - Library for building type-safe web API client. (Libs / Network)
- awesome-macos-libraries - APIKit - Type-safe networking abstraction layer that associates request type with response type. Language: Swift. (Network)
- awesome-ios-star - APIKit - A networking library for building type safe web API client in Swift. (Networking / Video)
- fucking-awesome-swift - APIKit - Library for building type-safe web API client. (Libs / Network)
- awesome-swift-cn - APIKit - a library for building type-safe web API client. (Libs / Network)
- awesome-swift - APIKit - Type-safe networking abstraction layer that associates request type with response type. ` 📝 4 months ago ` (Network [🔝](#readme))
README
APIKit
======[![Build Status](https://travis-ci.org/ishkawa/APIKit.svg?branch=master)](https://travis-ci.org/ishkawa/APIKit)
[![codecov](https://codecov.io/gh/ishkawa/APIKit/branch/master/graph/badge.svg)](https://codecov.io/gh/ishkawa/APIKit)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/APIKit.svg?style=flat)](http://cocoadocs.org/docsets/APIKit)
[![Platform](https://img.shields.io/cocoapods/p/APIKit.svg?style=flat)](http://cocoadocs.org/docsets/APIKit)
[![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)APIKit is a type-safe networking abstraction layer that associates request type with response type.
```swift
// SearchRepositoriesRequest conforms to Request protocol.
let request = SearchRepositoriesRequest(query: "swift")// Session receives an instance of a type that conforms to Request.
Session.send(request) { result in
switch result {
case .success(let response):
// Type of `response` is `[Repository]`,
// which is inferred from `SearchRepositoriesRequest`.
print(response)case .failure(let error):
self.printError(error)
}
}
```## Requirements
- Swift 5.3 or later
- iOS 9.0 or later
- Mac OS 10.10 or later
- watchOS 2.0 or later
- tvOS 9.0 or laterIf you use Swift 2.2 or 2.3, try [APIKit 2.0.5](https://github.com/ishkawa/APIKit/tree/2.0.5).
If you use Swift 4.2 or before, try [APIKit 4.1.0](https://github.com/ishkawa/APIKit/tree/4.1.0).
If you use Swift 5.2 or before, try [APIKit 5.3.0](https://github.com/ishkawa/APIKit/tree/5.3.0).
## Installation
#### [Carthage](https://github.com/Carthage/Carthage)
- Insert `github "ishkawa/APIKit" ~> 5.0` to your Cartfile.
- Run `carthage update`.
- Link your app with `APIKit.framework` in `Carthage/Build`.#### [CocoaPods](https://github.com/cocoapods/cocoapods)
- Insert `pod 'APIKit', '~> 5.0'` to your Podfile.
- Run `pod install`.Note: CocoaPods 1.4.0 is required to install APIKit 5.
## Documentation
- [Getting started](Documentation/GettingStarted.md)
- [Defining Request Protocol for Web Service](Documentation/DefiningRequestProtocolForWebService.md)
- [Convenience Parameters and Actual Parameters](Documentation/ConvenienceParametersAndActualParameters.md)### Advanced Guides
- [Customizing Networking Backend](Documentation/CustomizingNetworkingBackend.md)
### Migration Guides
- [APIKit 3 Migration Guide](Documentation/APIKit3MigrationGuide.md)
- [APIKit 2 Migration Guide](Documentation/APIKit2MigrationGuide.md)