Foreign exchange rates and currency conversion
By Jan Scheithauer.
Foreign exchange rates and currency conversion framework. Small swift wrapper around Fixer
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)")
}
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.
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.
CocoaPods is a dependency manager for Cocoa projects.
To install Forex, simply add the following line to your Podfile:
pod 'Forex', '~> 1.0'
See CHANGELOG.