Latest 5.0.0
Homepage https://github.com/ishkawa/APIKit
License MIT Copyright (c) 2015 – 2016 Yosuke Ishikawa
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0
Authors

Build Status
codecov
Carthage compatible
Version
Platform
Swift Package Manager

APIKit is a type-safe networking abstraction layer that associates request type with response type.

// 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.0 or later
  • iOS 8.0 or later
  • Mac OS 10.10 or later
  • watchOS 2.0 or later
  • tvOS 9.0 or later

If you use Swift 2.2 or 2.3, try APIKit 2.0.5.

If you use Swift 4.2 or before, try APIKit 4.1.0.

Installation

Carthage

  • Insert github "ishkawa/APIKit" ~> 5.0 to your Cartfile.
  • Run carthage update.
  • Link your app with APIKit.framework and Result.framework in Carthage/Build.

CocoaPods

  • Insert pod 'APIKit', '~> 5.0' to your Podfile.
  • Run pod install.

Note: CocoaPods 1.4.0 is required to install APIKit 5.

Documentation

Advanced Guides

Migration Guides

Latest podspec

{
    "name": "APIKit",
    "version": "5.0.0",
    "summary": "Type-safe networking abstraction layer that associates request type with response type.",
    "homepage": "https://github.com/ishkawa/APIKit",
    "authors": {
        "Yosuke Ishikawa": "[email protected]"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source_files": "Sources/**/*.{swift,h,m}",
    "source": {
        "git": "https://github.com/ishkawa/APIKit.git",
        "tag": "5.0.0"
    },
    "swift_versions": "5.0",
    "license": {
        "type": "MIT",
        "text": "      Copyright (c) 2015 - 2016 Yosuke Ishikawan      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:n      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.n      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.n"
    }
}

Pin It on Pinterest

Share This