Latest 0.0.4
Homepage https://github.com/google-books/swift-api-client
License MIT
Platforms ios 8.0
Authors

Google Books API Client Library for Swift

CocoaPods Version
License
Swift Version

The Google Books API Client Library for Swift

Installation

The supported options:

CocoaPods

Add this to Podfile

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'GoogleBooksApiClient'
end
$ pod install

Carthage

Add this to Cartfile

github "google-books/swift-api-client"
$ carthage update

How to use

The library makes it simple to call Google Books APIs.

import GoogleBooksApiClient

let session = URLSession.shared
let client = GoogleBooksApiClient(session: session)

Volume

list

let req = GoogleBooksApi.VolumeRequest.List(query: "Google")
let task: URLSessionDataTask = client.invoke(
    req,
    onSuccess: { volumes in NSLog("(volumes)" },
    onError: { error in NSLog("(error)") }
)
task.resume()

Mylibraly.Bookshlves

addVolume

let authInfo = GoogleBooksApiAuthInfo(apiKey: nil, authToken: "YOUR_AUTH_TOKEN")
let req = GoogleBooksApi.MyLibraryBookshelvesRequest.AddVolume(
    shelf: BookshelfId.haveRead,
    volumeId: Id("VOLUME_ID"),
    authInfo: authInfo
)
let task: URLSessionDataTask = client.invoke(
    req,
    onSuccess: { volumes in NSLog("(volumes)" },
    onError: { error in NSLog("(error)") }
)
task.resume()

License

MIT

Latest podspec

{
    "name": "GoogleBooksApiClient",
    "version": "0.0.4",
    "summary": "Google Books API Client Library for Swift",
    "description": "The Google Books API Client Library for Swift",
    "homepage": "https://github.com/google-books/swift-api-client",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "gomi_ningen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/google-books/swift-api-client.git",
        "tag": "0.0.4"
    },
    "social_media_url": "https://twitter.com/gomi_ningen",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "GoogleBooksApiClient/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This