GithubHelp home page GithubHelp logo

nomics-swift-sdk's Introduction

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

  • Usable in iOS, tvOS, watchOS and macOS
  • Simple API interface through enumerations
  • Type-safe API parameters
  • Easily extensible
  • 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.

nomics-swift-sdk's People

Contributors

ndizazzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

doovers reonarudo

nomics-swift-sdk's Issues

Can't implement via Swift Package Manager

When pasting the nomics-swift-sdk GitHub repo URL into File -> Swift Packages -> Add Package Dependency, I receive an error I believe is related to this repo not using semantic versioning syntax. I've attached a screenshot of the error I receive and it appears, the version of this repo is 1.0 instead of 1.0.0.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.