项目作者: jingx23

项目描述 :
Foreign exchange rates and currency conversion
高级语言: Swift
项目地址: git://github.com/jingx23/forex.git
创建时间: 2018-02-04T18:20:21Z
项目社区:https://github.com/jingx23/forex

开源协议:MIT License

下载


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

  1. import Forex
  2. //Specific exchange rate for a currency
  3. Forex.shared.rate(value: 1.0, from: .EUR, to: .USD) { (exchange, error) in
  4. print("Name:\(exchange?.currency.description) Rate: \(exchange?.value)")
  5. }
  6. Forex.shared.rate(value: 1.0, from: .EUR, to: [.USD, .RUB]) { (exchanges, error) in
  7. for exchange in exchanges ?? [] {
  8. print("Name:\(exchange.currency.description) Rate: \(exchange.value)")
  9. }
  10. }
  11. //Same goes with date option
  12. //Exchange rate for a specific date
  13. let dateFormatter = DateFormatter()
  14. dateFormatter.dateFormat = "yyyy-MM-dd"
  15. let exchangeDate = dateFormatter.date(from: "2000-01-03")
  16. Forex.shared.rate(value: 1.0, date: exchangeDate, from: .EUR, to: .USD) { (exchange, error) in
  17. print("Name:\(exchange?.currency.description) Rate: \(exchange?.value)")
  18. }

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:

  1. pod 'Forex', '~> 1.0'

Author

Changelog

See CHANGELOG.