Latest 1.0
Homepage https://github.com/ndizazzo/nomics-swift-sdk
License MIT
Platforms ios 11.0, osx 10.10, watchos 4.0, tvos 11.0
Frameworks Foundation
Authors

Nomics.com Swift SDK

Build
Version
Carthage Compatible
License
Platform
Swift

Table of Contents

Description

NomicsSDK is a simple API interface for crypto projects using the Nomics.com API written in Swift.

Key features

  • [x] Usable in iOS, tvOS, watchOS and macOS
  • [x] Simple API interface through enumerations
  • [x] Type-safe API parameters
  • [X] Easily extensible
  • [x] Unit test coverage & great documentation

Usage

General

Implementing and using the SDK is straightforward. To get started, simply include it by using your favourite package manager below. Or, you can install it manually.

import NomicsSDK

Then, create a APIConfig configuration object and instantiate the SDK with it:

let config = APIConfig(with: "2018-09-demo-dont-deploy-b69315e440beb145", for: .production)
let sdk = NomicsSDK(with: config)

After that, you can use request endpoints as you wish:

sdk.request(dataType: [Price].self, 
            endpoint: Endpoint.Currency.prices, 
            success: { data in
                // Data is an array of price objects
            }, error: { error in
                // Can be a decoding error, or a request error
            })

In order to make the generic request and decoding mechanism aware of what type of data will be passed into the callback, you need to provide the data type in the request method invocation.

Generally, you’ll only be concerned with two different types of calls:

[Price].self

and

Price.self

The former is when you want the SDK to decode an array of Price objects, and the latter is a single object. You can know which to use by checking out the endpoint documentation at nomics.com for detailed endpoint documentation.

Installation

Cocoapods

NomicsSDK is available through CocoaPods. To install, simply add the following line to your Podfile:

pod 'NomicsSDK'

Carthage

NomicsSDK is also available through Carthage.
To install, just write in your Cartfile:

github "ndizazzo/nomics-swift-sdk"

Swift Package Manager

NomicsSDK supports SPM! Add this line to your Package.swift file:

.Package(url: "https://github.com/ndizazzo/nomics-swift-sdk.git", from: "1.0.0")

Authors

  • Nomics.com provide the API this SDK interfaces with.
  • The TinyNetworking class is inspired by the efforts of the team at objc.io. Please refer the source file for additional context, as well as check out their work!
  • Nick DiZazzo made this with ❤️

Contributing

If you’d like to contribute to this project, check the simple CONTRIBUTING guidelines for more info.

License

NomicsSDK is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NomicsSDK",
    "version": "1.0",
    "summary": "Swift SDK for the Nomics.com API",
    "description": "NomicsSDK makes it easy to pull crypto market data from the Nomics.com API. nThe SDK is lightweight to ensure you don't need to include a lot of dependencies for your crypto projects.",
    "homepage": "https://github.com/ndizazzo/nomics-swift-sdk",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Nick DiZazzo": "[email protected]"
    },
    "platforms": {
        "ios": "11.0",
        "osx": "10.10",
        "watchos": "4.0",
        "tvos": "11.0"
    },
    "source": {
        "git": "https://github.com/ndizazzo/nomics-swift-sdk.git",
        "tag": "1.0"
    },
    "source_files": "NomicsSDK/Sources/**/*.swift",
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This