Latest 1.0.1
Homepage https://github.com/PlugForMac/HypeMachineAPI
License MIT
Platforms osx 10.11, requires ARC
Dependencies Alamofire
Authors

This is a partial implementation of the Hype Machine API in Swift. It is currently targetted at OSX but could easily be modified to work for iOS as well. Please create a pull request if you’d like iOS support.

Swift Compatability

Version 1.0 and beyond have been updated to work with Swift 3. Use the previous version, 0.5.4, for Swift 2.2.

Installation

Carthage

github "PlugForMac/HypeMachineAPI" ~> VERSION_NUMBER

CocoaPods

platform :osx, '10.11'
use_frameworks!

pod 'HypeMachineAPI', '~> VERSION_NUMBER'

Use

HypeMachineAPI.Requests.Blogs.index { response in
    switch response.result {
    case .success(let blogs):
        print(blogs)
    case .failure(let error):
        print(error)
    }
}

This API is build on top of Alamofire and uses it’s data types extensively. We use their DataResponse as the response for all requests, we also use their Result type to determine success or failure. Please check out their documentation for more info.

Note: requests return an instance of Alamofire DataRequest so that you can chain additional validations or make other modifications to the request if you need to.

You can find the source for all requests in the Source/*Request.swift files.

Latest podspec

{
    "name": "HypeMachineAPI",
    "version": "1.0.1",
    "summary": "This is a partial implementation of the Hype Machine API in Swift.",
    "homepage": "https://github.com/PlugForMac/HypeMachineAPI",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Alex Marchant": "[email protected]"
    },
    "platforms": {
        "osx": "10.11"
    },
    "source": {
        "git": "https://github.com/PlugForMac/HypeMachineAPI.git",
        "tag": "1.0.1"
    },
    "source_files": "Source/*.swift",
    "requires_arc": true,
    "dependencies": {
        "Alamofire": [
            "~> 4.0.1"
        ]
    },
    "pushed_with_swift_version": "3.0.1"
}

Pin It on Pinterest

Share This