Latest 0.2.0
Homepage https://github.com/Rubenfer/ExchangeSwift
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Description

You need ExchangeSwift if you want to use updated exchange rate in your Swift app. ExchangeSwift update rates daily by European Central Bank. You can also see historical exchange rates since 1999.

We use Fixer API.

Usage

Run the example project from the Example directory and check out ViewController.swift.

import ExchangeSwift

let exchange = ExchangeSwift()

// Last rate

exchange.getExchangeRate(base: .EUR) { (exchange) in

    // Here your code. For example:
    print("(exchange.date): 1EUR = (exchange.rates.USD)USD")

}

// Historical rate

exchange.getHistorical(base: .EUR, day: "12", month: "10", year: "2001") { (exchange) in

    // Now you have the exchange rates of 10/12/2001

}

Data types

The return of ExchangeSwift is:

public struct Exchange: Codable {

    public struct Rates: Codable {

        public let AUD: Float?
        public let BGN: Float?
        public let BRL: Float?
        public let CAD: Float?
        public let CHF: Float?
        public let CNY: Float?
        public let CZK: Float?
        public let DKK: Float?
        public let EUR: Float?
        public let GBP: Float?
        public let HKD: Float?
        public let HRK: Float?
        public let HUF: Float?
        public let IDR: Float?
        public let ILS: Float?
        public let INR: Float?
        public let ISK: Float?
        public let JPY: Float?
        public let KRW: Float?
        public let MXN: Float?
        public let MYR: Float?
        public let NOK: Float?
        public let NZD: Float?
        public let PHP: Float?
        public let PLN: Float?
        public let RON: Float?
        public let RUB: Float?
        public let SEK: Float?
        public let SGD: Float?
        public let THB: Float?
        public let TRY: Float?
        public let USD: Float?
        public let ZAR: Float?

    }

    public let base: String
    public let date: String
    public let rates: Rates

}

Installation

ExchangeSwift is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ExchangeSwift'

You can also copy into your project the file ExchangeSwift.framework

Requirements

iOS 8.0+ and Swift 4.0+ are required.

Author

I’m Ruben Fernandez
Email: [email protected]
Twitter: @RubenApps.

License

ExchangeSwift is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ExchangeSwift",
    "version": "0.2.0",
    "summary": "Get updated exchange rate of 32 currencies in you Swift app.",
    "description": "If you want to use updated exchange rate in your Swift app, you need ExchangeSwift. ExchangeSwift update rates daily by European Central Bank. You also can see historical exchange rates since 1999.",
    "homepage": "https://github.com/Rubenfer/ExchangeSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ruben Fernandez": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Rubenfer/ExchangeSwift.git",
        "tag": "0.2.0"
    },
    "social_media_url": "https://twitter.com/RubenApps",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ExchangeSwift/ExchangeSwift.swift",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This