Giter VIP home page Giter VIP logo

trefleswiftsdk's Introduction

โš ๏ธ Archived! Please Read First!

Sadly it seems like the Trefle project is over for now, and as I've not had time to work on this SDK myself either I have also decided to archive it. Please visit the main Trefle project for more details: https://github.com/treflehq/trefle-api


TrefleSwiftSDK

Swift Platforms SwiftPM Carthage CocoaPods Twitter

TrefleSwiftSDK is a Swift wrapper around the Trefle API.

This is currently a work in progress. There is a list of currently supported features listed below.

  • Authentication
  • Kingdoms
  • Subkingdoms
  • Divisions
  • Families
  • Genus
  • Plants
  • Species
  • Distribution Zones
  • Operation support
  • Combine support
  • Full error handling
  • Basic test suite
  • Deep test suite

Note: The current version of TrefleSwiftSDK is based on Trefle 1.6.0.

Prerequisites

Before you begin, ensure you have met the following requirements:

Installation

Swift Package Manager

To integrate TrefleSwiftSDK into your Xcode project using Swift Package Manager, add TrefleSwiftSDK as a dependency to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Baza207/TrefleSwiftSDK.git", .upToNextMajor(from: "0.1.0"))
]

Carthage

To integrate TrefleSwiftSDK into your Xcode project using Carthage, specify it in your Cartfile with the following:

github "Baza207/TrefleSwiftSDK" "0.1.0"

CocoaPods

To integrate TrefleSwiftSDK into your Xcode project using CocoaPods, specify it in your Podfile with the following:

pod 'TrefleSwiftSDK', '~> 0.1.0'

Usage

Basic Setup

Once you have a access token from your Trefle Profile you will also need to create an URI in your Xcode project. To do this you can follow the steps to Register Your URL Scheme in the Apple documentation.

Once you have this, you can import the TrefleSwiftSDK framework in your project and set it up for use.

  1. Import TrefleSwiftSDK in your AppDelegate:
import TrefleSwiftSDK
  1. Setup TrefleSwiftSDK by calling configure(accessToken:uri:) in application(_:didFinishLaunchingWithOptions:), passing in your access token from your Trefle Profile as well as the URI you setup in Xcode Info tab.
Trefle.configure(accessToken: "<Access Token>", uri: "<Redirect URI>")
  1. You can then use all the fetch and search calls from any of the managers in the project. All the authentication is handled by the framework using the given access token, meaning you don't have to worry about logging in users or logging them out. All the JWT autnetication and re-authentication on expired tokens is done automatically.

Contributors

James Barrow

License

MIT Licence

trefleswiftsdk's People

Contributors

baza207 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.