Skip to content
/ forex Public

Foreign exchange rates and currency conversion

License

Notifications You must be signed in to change notification settings

jingx23/forex

Repository files navigation

Forex

Build status Platform iOS Swift 4 compatible Carthage compatible CocoaPods compatible License: MIT

By Jan Scheithauer.

Introduction

Foreign exchange rates and currency conversion framework. Small swift wrapper around Fixer

Usage

import Forex
//Specific exchange rate for a currency
Forex.shared.rate(value: 1.0, from: .EUR, to: .USD) { (exchange, error) in
    print("Name:\(exchange?.currency.description) Rate: \(exchange?.value)")
}

Forex.shared.rate(value: 1.0, from: .EUR, to: [.USD, .RUB]) { (exchanges, error) in
        for exchange in exchanges ?? [] {
            print("Name:\(exchange.currency.description) Rate: \(exchange.value)")
        }
}

//Same goes with date option
//Exchange rate for a specific date
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
let exchangeDate = dateFormatter.date(from: "2000-01-03")

Forex.shared.rate(value: 1.0, date: exchangeDate, from: .EUR, to: .USD) { (exchange, error) in
    print("Name:\(exchange?.currency.description) Rate: \(exchange?.value)")
}

Getting involved

  • If you want to contribute please feel free to submit pull requests.
  • If you have a feature request please open an issue.
  • If you found a bug or need help please check older issues before submitting an issue.

Before contribute check the CONTRIBUTING file for more info.

If you use Forex in your app We would love to hear about it! Drop us a line on Twitter.

Examples

Follow these 3 steps to run Example project: clone Forex repository, open Forex workspace and run the Example project.

You can also experiment and learn with the Forex Playground which is contained in Forex.workspace.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

To install Forex, simply add the following line to your Podfile:

pod 'Forex', '~> 1.0'

Author

Changelog

See CHANGELOG.