diff --git a/CHANGELOG.md b/CHANGELOG.md index 58fc84d..6a7019f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.2.1 +1. [[MNY-19](https://github.com/danthorpe/Money/pull/19)]: Fixes a bunch of miscellaneous spelling mistakes in the README and code documentation. +2. [[MNY-20](https://github.com/danthorpe/Money/pull/20)]: Fixes a mistake where DVR which is only needed for the test suit was not in a private Cartfile. Also switches to the official @venmo DVR after recent merges in their project. Thanks to @dasmer for this. + # 1.2.0 1. [[MNY-18](https://github.com/danthorpe/Money/pull/18)]: Adds Bitcoin currency types and support for % commission with FX. * Creates `BTC` and `XBT` types. diff --git a/Cartfile b/Cartfile index 62b0ff2..f4eeaff 100644 --- a/Cartfile +++ b/Cartfile @@ -1,4 +1,3 @@ github "danthorpe/ValueCoding" github "antitypical/Result" >= 0.6 github "SwiftyJSON/SwiftyJSON" -github "danthorpe/DVR" "DVR_27_restore_print_and_abort" diff --git a/Cartfile.private b/Cartfile.private new file mode 100644 index 0000000..7c3e1ca --- /dev/null +++ b/Cartfile.private @@ -0,0 +1 @@ +github "venmo/DVR" ~> 0.1.3 diff --git a/Cartfile.resolved b/Cartfile.resolved index 064da12..06dc530 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,4 +1,4 @@ -github "danthorpe/DVR" "f0195d81d27a7d7633bd8c89ac7baa986fe8a21f" +github "venmo/DVR" "v0.1.4" github "antitypical/Result" "0.6.0-beta.6" github "SwiftyJSON/SwiftyJSON" "2.3.1" github "danthorpe/ValueCoding" "1.1.0" diff --git a/Money.podspec b/Money.podspec index 568362e..d854565 100644 --- a/Money.podspec +++ b/Money.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Money" - s.version = "1.2.0" + s.version = "1.2.1" s.summary = "Swift types for working with Money." s.description = <<-DESC diff --git a/Money.xcodeproj/project.pbxproj b/Money.xcodeproj/project.pbxproj index d84b606..c9155e9 100644 --- a/Money.xcodeproj/project.pbxproj +++ b/Money.xcodeproj/project.pbxproj @@ -759,7 +759,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"Will generate currency types using: $SCRIPT_INPUT_FILE_0\"\n\"$SCRIPT_INPUT_FILE_0\" \"$SCRIPT_OUTPUT_FILE_0\"\necho \"Generate complete\"\n\n\n\n\n"; + shellScript = "\"$SCRIPT_INPUT_FILE_0\" \"$SCRIPT_OUTPUT_FILE_0\"\n\n\n\n\n"; }; 65D305641BE955AE0032D99F /* Carthage Copy Frameworks */ = { isa = PBXShellScriptBuildPhase; diff --git a/Money/Autogenerated.swift b/Money/Autogenerated.swift index f1841a6..4887ccd 100644 --- a/Money/Autogenerated.swift +++ b/Money/Autogenerated.swift @@ -2,1801 +2,1524 @@ // Money, https://github.com/danthorpe/Money // Created by Dan Thorpe, @danthorpe // +// The MIT License (MIT) +// +// Copyright (c) 2015 Daniel Thorpe +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// // Autogenerated from build scripts, do not manually edit this file. extension Currency { /// Currency ADP public final class ADP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ADP(code: "ADP") } /// Currency AED public final class AED: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AED(code: "AED") } /// Currency AFA public final class AFA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AFA(code: "AFA") } /// Currency AFN public final class AFN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AFN(code: "AFN") } /// Currency ALK public final class ALK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ALK(code: "ALK") } /// Currency ALL public final class ALL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ALL(code: "ALL") } /// Currency AMD public final class AMD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AMD(code: "AMD") } /// Currency ANG public final class ANG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ANG(code: "ANG") } /// Currency AOA public final class AOA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AOA(code: "AOA") } /// Currency AOK public final class AOK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AOK(code: "AOK") } /// Currency AON public final class AON: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AON(code: "AON") } /// Currency AOR public final class AOR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AOR(code: "AOR") } /// Currency ARA public final class ARA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ARA(code: "ARA") } /// Currency ARL public final class ARL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ARL(code: "ARL") } /// Currency ARM public final class ARM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ARM(code: "ARM") } /// Currency ARP public final class ARP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ARP(code: "ARP") } /// Currency ARS public final class ARS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ARS(code: "ARS") } /// Currency ATS public final class ATS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ATS(code: "ATS") } /// Currency AUD public final class AUD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AUD(code: "AUD") } /// Currency AWG public final class AWG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AWG(code: "AWG") } /// Currency AZM public final class AZM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AZM(code: "AZM") } /// Currency AZN public final class AZN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = AZN(code: "AZN") } /// Currency BAD public final class BAD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BAD(code: "BAD") } /// Currency BAM public final class BAM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BAM(code: "BAM") } /// Currency BAN public final class BAN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BAN(code: "BAN") } /// Currency BBD public final class BBD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BBD(code: "BBD") } /// Currency BDT public final class BDT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BDT(code: "BDT") } /// Currency BEC public final class BEC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BEC(code: "BEC") } /// Currency BEF public final class BEF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BEF(code: "BEF") } /// Currency BEL public final class BEL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BEL(code: "BEL") } /// Currency BGL public final class BGL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BGL(code: "BGL") } /// Currency BGM public final class BGM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BGM(code: "BGM") } /// Currency BGN public final class BGN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BGN(code: "BGN") } /// Currency BGO public final class BGO: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BGO(code: "BGO") } /// Currency BHD public final class BHD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BHD(code: "BHD") } /// Currency BIF public final class BIF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BIF(code: "BIF") } /// Currency BMD public final class BMD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BMD(code: "BMD") } /// Currency BND public final class BND: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BND(code: "BND") } /// Currency BOB public final class BOB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BOB(code: "BOB") } /// Currency BOL public final class BOL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BOL(code: "BOL") } /// Currency BOP public final class BOP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BOP(code: "BOP") } /// Currency BOV public final class BOV: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BOV(code: "BOV") } /// Currency BRB public final class BRB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRB(code: "BRB") } /// Currency BRC public final class BRC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRC(code: "BRC") } /// Currency BRE public final class BRE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRE(code: "BRE") } /// Currency BRL public final class BRL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRL(code: "BRL") } /// Currency BRN public final class BRN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRN(code: "BRN") } /// Currency BRR public final class BRR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRR(code: "BRR") } /// Currency BRZ public final class BRZ: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BRZ(code: "BRZ") } /// Currency BSD public final class BSD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BSD(code: "BSD") } /// Currency BTN public final class BTN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BTN(code: "BTN") } /// Currency BUK public final class BUK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BUK(code: "BUK") } /// Currency BWP public final class BWP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BWP(code: "BWP") } /// Currency BYB public final class BYB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BYB(code: "BYB") } /// Currency BYR public final class BYR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BYR(code: "BYR") } /// Currency BZD public final class BZD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = BZD(code: "BZD") } /// Currency CAD public final class CAD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CAD(code: "CAD") } /// Currency CDF public final class CDF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CDF(code: "CDF") } /// Currency CHE public final class CHE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CHE(code: "CHE") } /// Currency CHF public final class CHF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CHF(code: "CHF") } /// Currency CHW public final class CHW: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CHW(code: "CHW") } /// Currency CLE public final class CLE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CLE(code: "CLE") } /// Currency CLF public final class CLF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CLF(code: "CLF") } /// Currency CLP public final class CLP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CLP(code: "CLP") } /// Currency CNX public final class CNX: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CNX(code: "CNX") } /// Currency CNY public final class CNY: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CNY(code: "CNY") } /// Currency COP public final class COP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = COP(code: "COP") } /// Currency COU public final class COU: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = COU(code: "COU") } /// Currency CRC public final class CRC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CRC(code: "CRC") } /// Currency CSD public final class CSD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CSD(code: "CSD") } /// Currency CSK public final class CSK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CSK(code: "CSK") } /// Currency CUC public final class CUC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CUC(code: "CUC") } /// Currency CUP public final class CUP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CUP(code: "CUP") } /// Currency CVE public final class CVE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CVE(code: "CVE") } /// Currency CYP public final class CYP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CYP(code: "CYP") } /// Currency CZK public final class CZK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = CZK(code: "CZK") } /// Currency DDM public final class DDM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = DDM(code: "DDM") } /// Currency DEM public final class DEM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = DEM(code: "DEM") } /// Currency DJF public final class DJF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = DJF(code: "DJF") } /// Currency DKK public final class DKK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = DKK(code: "DKK") } /// Currency DOP public final class DOP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = DOP(code: "DOP") } /// Currency DZD public final class DZD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = DZD(code: "DZD") } /// Currency ECS public final class ECS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ECS(code: "ECS") } /// Currency ECV public final class ECV: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ECV(code: "ECV") } /// Currency EEK public final class EEK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = EEK(code: "EEK") } /// Currency EGP public final class EGP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = EGP(code: "EGP") } /// Currency EQE public final class EQE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = EQE(code: "EQE") } /// Currency ERN public final class ERN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ERN(code: "ERN") } /// Currency ESA public final class ESA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ESA(code: "ESA") } /// Currency ESB public final class ESB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ESB(code: "ESB") } /// Currency ESP public final class ESP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ESP(code: "ESP") } /// Currency ETB public final class ETB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ETB(code: "ETB") } /// Currency EUR public final class EUR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = EUR(code: "EUR") } /// Currency FIM public final class FIM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = FIM(code: "FIM") } /// Currency FJD public final class FJD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = FJD(code: "FJD") } /// Currency FKP public final class FKP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = FKP(code: "FKP") } /// Currency FRF public final class FRF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = FRF(code: "FRF") } /// Currency GBP public final class GBP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GBP(code: "GBP") } /// Currency GEK public final class GEK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GEK(code: "GEK") } /// Currency GEL public final class GEL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GEL(code: "GEL") } /// Currency GHC public final class GHC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GHC(code: "GHC") } /// Currency GHS public final class GHS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GHS(code: "GHS") } /// Currency GIP public final class GIP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GIP(code: "GIP") } /// Currency GMD public final class GMD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GMD(code: "GMD") } /// Currency GNF public final class GNF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GNF(code: "GNF") } /// Currency GNS public final class GNS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GNS(code: "GNS") } /// Currency GQE public final class GQE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GQE(code: "GQE") } /// Currency GRD public final class GRD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GRD(code: "GRD") } /// Currency GTQ public final class GTQ: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GTQ(code: "GTQ") } /// Currency GWE public final class GWE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GWE(code: "GWE") } /// Currency GWP public final class GWP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GWP(code: "GWP") } /// Currency GYD public final class GYD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = GYD(code: "GYD") } /// Currency HKD public final class HKD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = HKD(code: "HKD") } /// Currency HNL public final class HNL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = HNL(code: "HNL") } /// Currency HRD public final class HRD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = HRD(code: "HRD") } /// Currency HRK public final class HRK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = HRK(code: "HRK") } /// Currency HTG public final class HTG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = HTG(code: "HTG") } /// Currency HUF public final class HUF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = HUF(code: "HUF") } /// Currency IDR public final class IDR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = IDR(code: "IDR") } /// Currency IEP public final class IEP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = IEP(code: "IEP") } /// Currency ILP public final class ILP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ILP(code: "ILP") } /// Currency ILR public final class ILR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ILR(code: "ILR") } /// Currency ILS public final class ILS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ILS(code: "ILS") } /// Currency INR public final class INR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = INR(code: "INR") } /// Currency IQD public final class IQD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = IQD(code: "IQD") } /// Currency IRR public final class IRR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = IRR(code: "IRR") } /// Currency ISJ public final class ISJ: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ISJ(code: "ISJ") } /// Currency ISK public final class ISK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ISK(code: "ISK") } /// Currency ITL public final class ITL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ITL(code: "ITL") } /// Currency JMD public final class JMD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = JMD(code: "JMD") } /// Currency JOD public final class JOD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = JOD(code: "JOD") } /// Currency JPY public final class JPY: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = JPY(code: "JPY") } /// Currency KES public final class KES: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KES(code: "KES") } /// Currency KGS public final class KGS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KGS(code: "KGS") } /// Currency KHR public final class KHR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KHR(code: "KHR") } /// Currency KMF public final class KMF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KMF(code: "KMF") } /// Currency KPW public final class KPW: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KPW(code: "KPW") } /// Currency KRH public final class KRH: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KRH(code: "KRH") } /// Currency KRO public final class KRO: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KRO(code: "KRO") } /// Currency KRW public final class KRW: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KRW(code: "KRW") } /// Currency KWD public final class KWD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KWD(code: "KWD") } /// Currency KYD public final class KYD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KYD(code: "KYD") } /// Currency KZT public final class KZT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = KZT(code: "KZT") } /// Currency LAK public final class LAK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LAK(code: "LAK") } /// Currency LBP public final class LBP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LBP(code: "LBP") } /// Currency LKR public final class LKR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LKR(code: "LKR") } /// Currency LRD public final class LRD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LRD(code: "LRD") } /// Currency LSL public final class LSL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LSL(code: "LSL") } /// Currency LSM public final class LSM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LSM(code: "LSM") } /// Currency LTL public final class LTL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LTL(code: "LTL") } /// Currency LTT public final class LTT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LTT(code: "LTT") } /// Currency LUC public final class LUC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LUC(code: "LUC") } /// Currency LUF public final class LUF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LUF(code: "LUF") } /// Currency LUL public final class LUL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LUL(code: "LUL") } /// Currency LVL public final class LVL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LVL(code: "LVL") } /// Currency LVR public final class LVR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LVR(code: "LVR") } /// Currency LYD public final class LYD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = LYD(code: "LYD") } /// Currency MAD public final class MAD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MAD(code: "MAD") } /// Currency MAF public final class MAF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MAF(code: "MAF") } /// Currency MCF public final class MCF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MCF(code: "MCF") } /// Currency MDC public final class MDC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MDC(code: "MDC") } /// Currency MDL public final class MDL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MDL(code: "MDL") } /// Currency MGA public final class MGA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MGA(code: "MGA") } /// Currency MGF public final class MGF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MGF(code: "MGF") } /// Currency MKD public final class MKD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MKD(code: "MKD") } /// Currency MKN public final class MKN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MKN(code: "MKN") } /// Currency MLF public final class MLF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MLF(code: "MLF") } /// Currency MMK public final class MMK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MMK(code: "MMK") } /// Currency MNT public final class MNT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MNT(code: "MNT") } /// Currency MOP public final class MOP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MOP(code: "MOP") } /// Currency MRO public final class MRO: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MRO(code: "MRO") } /// Currency MTL public final class MTL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MTL(code: "MTL") } /// Currency MTP public final class MTP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MTP(code: "MTP") } /// Currency MUR public final class MUR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MUR(code: "MUR") } /// Currency MVP public final class MVP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MVP(code: "MVP") } /// Currency MVR public final class MVR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MVR(code: "MVR") } /// Currency MWK public final class MWK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MWK(code: "MWK") } /// Currency MXN public final class MXN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MXN(code: "MXN") } /// Currency MXP public final class MXP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MXP(code: "MXP") } /// Currency MXV public final class MXV: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MXV(code: "MXV") } /// Currency MYR public final class MYR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MYR(code: "MYR") } /// Currency MZE public final class MZE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MZE(code: "MZE") } /// Currency MZM public final class MZM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MZM(code: "MZM") } /// Currency MZN public final class MZN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = MZN(code: "MZN") } /// Currency NAD public final class NAD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NAD(code: "NAD") } /// Currency NGN public final class NGN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NGN(code: "NGN") } /// Currency NIC public final class NIC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NIC(code: "NIC") } /// Currency NIO public final class NIO: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NIO(code: "NIO") } /// Currency NLG public final class NLG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NLG(code: "NLG") } /// Currency NOK public final class NOK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NOK(code: "NOK") } /// Currency NPR public final class NPR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NPR(code: "NPR") } /// Currency NZD public final class NZD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = NZD(code: "NZD") } /// Currency OMR public final class OMR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = OMR(code: "OMR") } /// Currency PAB public final class PAB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PAB(code: "PAB") } /// Currency PEI public final class PEI: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PEI(code: "PEI") } /// Currency PEN public final class PEN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PEN(code: "PEN") } /// Currency PES public final class PES: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PES(code: "PES") } /// Currency PGK public final class PGK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PGK(code: "PGK") } /// Currency PHP public final class PHP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PHP(code: "PHP") } /// Currency PKR public final class PKR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PKR(code: "PKR") } /// Currency PLN public final class PLN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PLN(code: "PLN") } /// Currency PLZ public final class PLZ: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PLZ(code: "PLZ") } /// Currency PTE public final class PTE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PTE(code: "PTE") } /// Currency PYG public final class PYG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = PYG(code: "PYG") } /// Currency QAR public final class QAR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = QAR(code: "QAR") } /// Currency RHD public final class RHD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = RHD(code: "RHD") } /// Currency ROL public final class ROL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ROL(code: "ROL") } /// Currency RON public final class RON: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = RON(code: "RON") } /// Currency RSD public final class RSD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = RSD(code: "RSD") } /// Currency RUB public final class RUB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = RUB(code: "RUB") } /// Currency RUR public final class RUR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = RUR(code: "RUR") } /// Currency RWF public final class RWF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = RWF(code: "RWF") } /// Currency SAR public final class SAR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SAR(code: "SAR") } /// Currency SBD public final class SBD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SBD(code: "SBD") } /// Currency SCR public final class SCR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SCR(code: "SCR") } /// Currency SDD public final class SDD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SDD(code: "SDD") } /// Currency SDG public final class SDG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SDG(code: "SDG") } /// Currency SDP public final class SDP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SDP(code: "SDP") } /// Currency SEK public final class SEK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SEK(code: "SEK") } /// Currency SGD public final class SGD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SGD(code: "SGD") } /// Currency SHP public final class SHP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SHP(code: "SHP") } /// Currency SIT public final class SIT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SIT(code: "SIT") } /// Currency SKK public final class SKK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SKK(code: "SKK") } /// Currency SLL public final class SLL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SLL(code: "SLL") } /// Currency SOS public final class SOS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SOS(code: "SOS") } /// Currency SRD public final class SRD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SRD(code: "SRD") } /// Currency SRG public final class SRG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SRG(code: "SRG") } /// Currency SSP public final class SSP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SSP(code: "SSP") } /// Currency STD public final class STD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = STD(code: "STD") } /// Currency SUR public final class SUR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SUR(code: "SUR") } /// Currency SVC public final class SVC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SVC(code: "SVC") } /// Currency SYP public final class SYP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SYP(code: "SYP") } /// Currency SZL public final class SZL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = SZL(code: "SZL") } /// Currency THB public final class THB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = THB(code: "THB") } /// Currency TJR public final class TJR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TJR(code: "TJR") } /// Currency TJS public final class TJS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TJS(code: "TJS") } /// Currency TMM public final class TMM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TMM(code: "TMM") } /// Currency TMT public final class TMT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TMT(code: "TMT") } /// Currency TND public final class TND: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TND(code: "TND") } /// Currency TOP public final class TOP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TOP(code: "TOP") } /// Currency TPE public final class TPE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TPE(code: "TPE") } /// Currency TRL public final class TRL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TRL(code: "TRL") } /// Currency TRY public final class TRY: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TRY(code: "TRY") } /// Currency TTD public final class TTD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TTD(code: "TTD") } /// Currency TWD public final class TWD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TWD(code: "TWD") } /// Currency TZS public final class TZS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = TZS(code: "TZS") } /// Currency UAH public final class UAH: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UAH(code: "UAH") } /// Currency UAK public final class UAK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UAK(code: "UAK") } /// Currency UGS public final class UGS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UGS(code: "UGS") } /// Currency UGX public final class UGX: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UGX(code: "UGX") } /// Currency USD public final class USD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = USD(code: "USD") } /// Currency USN public final class USN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = USN(code: "USN") } /// Currency USS public final class USS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = USS(code: "USS") } /// Currency UYI public final class UYI: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UYI(code: "UYI") } /// Currency UYP public final class UYP: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UYP(code: "UYP") } /// Currency UYU public final class UYU: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UYU(code: "UYU") } /// Currency UZS public final class UZS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = UZS(code: "UZS") } /// Currency VEB public final class VEB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = VEB(code: "VEB") } /// Currency VEF public final class VEF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = VEF(code: "VEF") } /// Currency VND public final class VND: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = VND(code: "VND") } /// Currency VNN public final class VNN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = VNN(code: "VNN") } /// Currency VUV public final class VUV: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = VUV(code: "VUV") } /// Currency WST public final class WST: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = WST(code: "WST") } /// Currency XAF public final class XAF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XAF(code: "XAF") } /// Currency XAG public final class XAG: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XAG(code: "XAG") } /// Currency XAU public final class XAU: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XAU(code: "XAU") } /// Currency XBA public final class XBA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XBA(code: "XBA") } /// Currency XBB public final class XBB: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XBB(code: "XBB") } /// Currency XBC public final class XBC: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XBC(code: "XBC") } /// Currency XBD public final class XBD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XBD(code: "XBD") } /// Currency XCD public final class XCD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XCD(code: "XCD") } /// Currency XDR public final class XDR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XDR(code: "XDR") } /// Currency XEU public final class XEU: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XEU(code: "XEU") } /// Currency XFO public final class XFO: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XFO(code: "XFO") } /// Currency XFU public final class XFU: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XFU(code: "XFU") } /// Currency XOF public final class XOF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XOF(code: "XOF") } /// Currency XPD public final class XPD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XPD(code: "XPD") } /// Currency XPF public final class XPF: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XPF(code: "XPF") } /// Currency XPT public final class XPT: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XPT(code: "XPT") } /// Currency XRE public final class XRE: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XRE(code: "XRE") } /// Currency XSU public final class XSU: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XSU(code: "XSU") } /// Currency XTS public final class XTS: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XTS(code: "XTS") } /// Currency XUA public final class XUA: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XUA(code: "XUA") } /// Currency XXX public final class XXX: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = XXX(code: "XXX") } /// Currency YDD public final class YDD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = YDD(code: "YDD") } /// Currency YER public final class YER: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = YER(code: "YER") } /// Currency YUD public final class YUD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = YUD(code: "YUD") } /// Currency YUM public final class YUM: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = YUM(code: "YUM") } /// Currency YUN public final class YUN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = YUN(code: "YUN") } /// Currency YUR public final class YUR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = YUR(code: "YUR") } /// Currency ZAL public final class ZAL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZAL(code: "ZAL") } /// Currency ZAR public final class ZAR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZAR(code: "ZAR") } /// Currency ZMK public final class ZMK: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZMK(code: "ZMK") } /// Currency ZMW public final class ZMW: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZMW(code: "ZMW") } /// Currency ZRN public final class ZRN: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZRN(code: "ZRN") } /// Currency ZRZ public final class ZRZ: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZRZ(code: "ZRZ") } /// Currency ZWL public final class ZWL: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZWL(code: "ZWL") } /// Currency ZWR public final class ZWR: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZWR(code: "ZWR") } /// Currency ZWD public final class ZWD: Currency.Base, _CurrencyType { - /// Lazy static storage for currency. public static var sharedInstance = ZWD(code: "ZWD") } } diff --git a/Money/Currency.swift b/Money/Currency.swift index 1f58752..9f4a534 100644 --- a/Money/Currency.swift +++ b/Money/Currency.swift @@ -119,7 +119,9 @@ public extension _CurrencyType { public struct Currency { /** + # Currency.Base + `Currency.Base` is a class which composes a number formatter and a locale. It doesn't conform to `CurrencyType` but it can be used as a base class for currency types which only require @@ -146,9 +148,11 @@ public struct Currency { } /** + # Currency.Local + `Currency.Local` is a `BaseCurrency` subclass which represents - the device's current currency, using `NSLocale.currencyLocale()`. + the device's current currency, using `NSLocale.currentLocale()`. */ public final class Local: Currency.Base, _CurrencyType { public static var sharedInstance = Local(locale: NSLocale.currentLocale()) diff --git a/Money/Decimal/Decimal.swift b/Money/Decimal/Decimal.swift index 1db29c5..9e67a09 100644 --- a/Money/Decimal/Decimal.swift +++ b/Money/Decimal/Decimal.swift @@ -42,22 +42,6 @@ public struct _Decimal: DecimalNumberType { /// Access the underlying decimal storage. /// - returns: the `NSDecimalNumber` public let storage: NSDecimalNumber - - /// Flag to indicate if the decimal number is less than zero - public var isNegative: Bool { - return storage.isNegative - } - - /// The negative of Self. - /// - returns: a `_Decimal` - public var negative: _Decimal { - return _Decimal(storage: storage.negateWithBehaviors(Behavior.decimalNumberBehaviors)) - } - - /// Text description. - public var description: String { - return "\(storage.description)" - } /** Initialize a new value using the underlying decimal storage. @@ -67,97 +51,16 @@ public struct _Decimal: DecimalNumberType { public init(storage: NSDecimalNumber = NSDecimalNumber.zero()) { self.storage = storage } - - /** - Initialize a new value using a `FloatLiteralType` - - - parameter floatLiteral: a `FloatLiteralType` for the system, probably `Double`. - */ - public init(floatLiteral value: FloatLiteralType) { - self.init(storage: NSDecimalNumber(floatLiteral: value).decimalNumberByRoundingAccordingToBehavior(Behavior.decimalNumberBehaviors)) - } - - /** - Initialize a new value using a `IntegerLiteralType` - - - parameter integerLiteral: a `IntegerLiteralType` for the system, probably `Int`. - */ - public init(integerLiteral value: IntegerLiteralType) { - switch value { - case 0: - self.init(storage: NSDecimalNumber.zero()) - case 1: - self.init(storage: NSDecimalNumber.one()) - default: - self.init(storage: NSDecimalNumber(integerLiteral: value).decimalNumberByRoundingAccordingToBehavior(Behavior.decimalNumberBehaviors)) - } - } - - /** - Subtract a matching `_Decimal` from the receiver. - - - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: another instance of this type. - */ - @warn_unused_result - public func subtract(other: _Decimal) -> _Decimal { - return _Decimal(storage: storage.subtract(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Add a matching `_Decimal` from the receiver. - - - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: another instance of this type. - */ - @warn_unused_result - public func add(other: _Decimal) -> _Decimal { - return _Decimal(storage: storage.add(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Multiply a matching `_Decimal` from the receiver. - - - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: another instance of this type. - */ - @warn_unused_result - public func multiplyBy(other: _Decimal) -> _Decimal { - return _Decimal(storage: storage.multiplyBy(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Divide a matching `_Decimal` from the receiver. - - - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: another instance of this type. - */ - @warn_unused_result - public func divideBy(other: _Decimal) -> _Decimal { - return _Decimal(storage: storage.divideBy(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - The remainder of dividing another `_Decimal` into the receiver. - - - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: another instance of this type. - */ - @warn_unused_result - public func remainder(other: _Decimal) -> _Decimal { - return _Decimal(storage: storage.remainder(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) - } } +// MARK: - Equality + public func ==(lhs: _Decimal, rhs: _Decimal) -> Bool { return lhs.storage == rhs.storage } +// MARK: - Comparable + public func <(lhs: _Decimal, rhs: _Decimal) -> Bool { return lhs.storage < rhs.storage } diff --git a/Money/Decimal/DecimalNumberType.swift b/Money/Decimal/DecimalNumberType.swift index 7a00b44..9c6a0bd 100644 --- a/Money/Decimal/DecimalNumberType.swift +++ b/Money/Decimal/DecimalNumberType.swift @@ -76,9 +76,10 @@ public struct DecimalNumberBehavior { } } - /** + # DecimalNumberType + A protocol which defines the necessary interface to support decimal number calculations and operators. */ @@ -177,17 +178,133 @@ public protocol DecimalNumberType: SignedNumberType, IntegerLiteralConvertible, func remainder(_: Self) -> Self } +// MARK: - Extensions + +/** + Extensions on `DecimalNumberType` where the underlying storage type + is `NSDecimalNumber`. + */ public extension DecimalNumberType where DecimalStorageType == NSDecimalNumber { + /// Flag to indicate if the decimal number is less than zero + public var isNegative: Bool { + return storage.isNegative + } + + /// The negative of Self. + /// - returns: a `_Decimal` + public var negative: Self { + return Self(storage: storage.negateWithBehaviors(DecimalNumberBehavior.decimalNumberBehaviors)) + } + + /// Text description. + public var description: String { + return "\(storage.description)" + } + + /** + Initialize a new value using a `FloatLiteralType` + + - parameter floatLiteral: a `FloatLiteralType` for the system, probably `Double`. + */ + public init(floatLiteral value: Swift.FloatLiteralType) { + self.init(storage: NSDecimalNumber(floatLiteral: value).decimalNumberByRoundingAccordingToBehavior(DecimalNumberBehavior.decimalNumberBehaviors)) + } + + /** + Initialize a new value using a `IntegerLiteralType` + + - parameter integerLiteral: a `IntegerLiteralType` for the system, probably `Int`. + */ + public init(integerLiteral value: Swift.IntegerLiteralType) { + switch value { + case 0: + self.init(storage: NSDecimalNumber.zero()) + case 1: + self.init(storage: NSDecimalNumber.one()) + default: + self.init(storage: NSDecimalNumber(integerLiteral: value).decimalNumberByRoundingAccordingToBehavior(DecimalNumberBehavior.decimalNumberBehaviors)) + } + } + + /** + Subtract a matching `DecimalNumberType` from the receiver. + + - parameter other: another instance of this type. + - returns: another instance of this type. + */ + @warn_unused_result + public func subtract(other: Self) -> Self { + return Self(storage: storage.subtract(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) + } + + /** + Add a matching `DecimalNumberType` from the receiver. + + - parameter other: another instance of this type. + - returns: another instance of this type. + */ + @warn_unused_result + public func add(other: Self) -> Self { + return Self(storage: storage.add(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) + } + + /** + Multiply a matching `DecimalNumberType` with the receiver. + + - parameter other: another instance of this type. + - returns: another instance of this type. + */ + @warn_unused_result + public func multiplyBy(other: Self) -> Self { + return Self(storage: storage.multiplyBy(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) + } + + /** + Multiply a different `DecimalNumberType` which also has `NSDecimalNumber` + as the storage type with the receiver. + + - parameter other: another `DecimalNumberType` with `NSDecimalNumber` storage. + - returns: another instance of this type. + */ @warn_unused_result func multiplyBy(other: Other) -> Other { return Other(storage: storage.multiplyBy(other.storage, withBehaviors: Other.DecimalNumberBehavior.decimalNumberBehaviors) ) } + /** + Divide the receiver by another instance of this type. + + - parameter other: another instance of this type. + - returns: another instance of this type. + */ + @warn_unused_result + public func divideBy(other: Self) -> Self { + return Self(storage: storage.divideBy(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) + } + + /** + Divide the receiver by a different `DecimalNumberType` which also has `NSDecimalNumber` + as the storage type. + + - parameter other: another `DecimalNumberType` with `NSDecimalNumber` storage. + - returns: another instance of this type. + */ @warn_unused_result func divideBy(other: Other) -> Other { return Other(storage: storage.divideBy(other.storage, withBehaviors: Other.DecimalNumberBehavior.decimalNumberBehaviors)) } + + /** + The remainder of dividing another instance of this type into the receiver. + + - parameter other: another instance of this type. + - returns: another instance of this type. + */ + @warn_unused_result + public func remainder(other: Self) -> Self { + return Self(storage: storage.remainder(other.storage, withBehaviors: DecimalNumberBehavior.decimalNumberBehaviors)) + } } extension DecimalNumberType where Self.IntegerLiteralType == Int { @@ -198,6 +315,7 @@ extension DecimalNumberType where Self.IntegerLiteralType == Int { } } + // MARK: - Operators // MARK: - Subtraction diff --git a/Money/Money.swift b/Money/Money.swift index a869622..d421076 100644 --- a/Money/Money.swift +++ b/Money/Money.swift @@ -29,7 +29,9 @@ import Foundation import ValueCoding /** + # MoneyType + `MoneyType` is a protocol which refines `DecimalNumberType`. It adds a generic type for the currency. */ @@ -39,16 +41,19 @@ public protocol MoneyType: DecimalNumberType, ValueCoding { /// Access the underlying decimal var decimal: _Decimal { get } + /// Initialize the money with a decimal init(_: _Decimal) } /** + # Money + `_Money` is a value type, conforming to `MoneyType`, which is generic over the currency type. To work in whatever the local currency is, use `Money`. It should not - be necessary to use `_Money` directly, instead, use a currency - typealias, such as `USD` or `GBP`. + be necessary to use `_Money` directly, instead, use a typealias, + such as `USD` or `GBP`. */ public struct _Money: MoneyType { @@ -96,18 +101,18 @@ public struct _Money: MoneyType { } /** - Initialize a new value using a `FloatLiteralType` + Initialize a new value using a `IntegerLiteralType` - - parameter floatLiteral: a `FloatLiteralType` for the system, probably `Double`. + - parameter integerLiteral: a `IntegerLiteralType` for the system, probably `Int`. */ public init(integerLiteral value: IntegerLiteralType) { decimal = _Decimal(integerLiteral: value) } /** - Initialize a new value using a `IntegerLiteralType` + Initialize a new value using a `FloatLiteralType` - - parameter integerLiteral: a `IntegerLiteralType` for the system, probably `Int`. + - parameter floatLiteral: a `FloatLiteralType` for the system, probably `Double`. */ public init(floatLiteral value: FloatLiteralType) { decimal = _Decimal(floatLiteral: value) @@ -117,7 +122,6 @@ public struct _Money: MoneyType { Subtract a matching `_Money` from the receiver. - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - returns: another instance of this type. */ @warn_unused_result @@ -129,7 +133,6 @@ public struct _Money: MoneyType { Add a matching `_Money` from the receiver. - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - returns: another instance of this type. */ @warn_unused_result @@ -141,7 +144,6 @@ public struct _Money: MoneyType { Multiply a matching `_Money` from the receiver. - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - returns: another instance of this type. */ @@ -154,7 +156,6 @@ public struct _Money: MoneyType { Divide a matching `_Money` from the receiver. - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - returns: another instance of this type. */ @warn_unused_result @@ -166,7 +167,6 @@ public struct _Money: MoneyType { The remainder of dividing another `_Money` into the receiver. - parameter other: another instance of this type. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - returns: another instance of this type. */ @warn_unused_result @@ -205,7 +205,9 @@ extension _Money: CustomStringConvertible { } /** + ### Localized Formatted String + This function will format the Money type into a string suitable for the current localization. It accepts an parameter for the style `NSNumberFormatterStyle`. Note that iOS 9 and OS X 10.11 @@ -228,6 +230,9 @@ public extension MoneyType where DecimalStorageType == BankersDecimal.DecimalSto Use a `BankersDecimal` to convert the receive into another `MoneyType`. To use this API the underlying `DecimalStorageType`s between the receiver, the other `MoneyType` must both be the same a that of `BankersDecimal` (which luckily they are). + + - parameter rate: a `BankersDecimal` representing the rate. + - returns: another `MoneyType` value. */ @warn_unused_result func convertWithRate(rate: BankersDecimal) -> Other { diff --git a/README.md b/README.md index cb007bc..33e7243 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,15 @@ print("I'll give \(money) to charity.”) will print out -> I'll give $100.00 to charity +> I'll give $ 100.00 to charity when the region is set to United States -> I'll give £100.00 to charity +> I'll give £ 100.00 to charity when the region is set to United Kingdom -> I'll give CN¥100.00 to charity +> I'll give CN¥ 100.00 to charity when the region is set to China @@ -41,7 +41,7 @@ You get the idea. ## Specific Currency -Under the hood, `Money` is a `typealias` for `_Money` where `Currency.Local` is a specific `CurrencyType` which represents the currency for the current local. This means that it is strongly typed to the local currency. +Under the hood, `Money` is a `typealias` for `_Money` where `Currency.Local` is a specific `CurrencyType` which represents the currency for the current locale. This means that it is strongly typed to the local currency. In a similar way, there are 298 foreign currency types supported. @@ -61,12 +61,12 @@ let money = pounds + euros ``` > Binary operator '+' cannot be applied to operands of type 'GBP' (aka '_Money<Currency.GBP>') and 'EUR' (aka '_Money<Currency.EUR>') -Of course, `Money` supports the usual suspects of decimal arithmetic operators, so you can add, subtract, multiply, divide values of the same type, and values with `Int` and `Double` with some limitations. +Of course, `Money` supports the usual suspects of decimal arithmetic operators, so you can add, subtract, multiply, divide values of the same type, and values with `Int` and `Double` with the expected limitations. ## Foreign Currency Exchange (FX) To represent a foreign exchange transaction, i.e. converting `USD` to `EUR`, use a FX service provider. There is built in support for [Yahoo](https://finance.yahoo.com/currency-converter/#from=USD;to=EUR;amt=1) and [OpenExchangeRates.org](https://openexchangerates.org) services. But it’s possible for consumers to create their own too. -The following code snippet represent a currency exchange using Yahoo’s currency converter. +The following code snippet represents a currency exchange using Yahoo’s currency converter. ```swift Yahoo.quote(100) { result in @@ -80,7 +80,7 @@ Yahoo.quote(100) { result in The result, delivered asynchronously, uses [`Result`](http://github.com/antitypical/Result) to encapsulate either a `FXTransaction` or an `FXError` value. Obviously, in real code - you’d need to check for errors ;) -`FXTransaction` is a generic type which captures the base and counter monies, the rate of the exchange, and any commission the FX service provider charged in the base currency. Currently `FXQuote` only supports percentage based commission. +`FXTransaction` is a generic type which composes the base and counter monies, the rate of the exchange, and any commission the FX service provider charged in the base currency. Currently `FXQuote` only supports percentage based commission. There is a neat convenience function which just returns the `CounterMoney` as its `Result` value type. @@ -94,7 +94,7 @@ Yahoo.fx(100) { euros in ### Creating custom FX service providers -Creating a custom FX service provider is straightforward. The protocols `FXLocalProviderType` and `FXRemoteProviderType` define the minimum requirements. The `fx` method is provided via extensions on the protocols. +Creating a custom FX service provider is straightforward. The protocols `FXLocalProviderType` and `FXRemoteProviderType` define the minimum requirements. The `quote` and `fx` methods are provided via extensions on the protocols. For a remote FX service provider, i.e. one which will make a network request to get a rate, we can look at the `Yahoo` provider to see how it works. @@ -118,7 +118,7 @@ public static func request() -> NSURLRequest { The last requirement, is that the network result can be mapped into a `Result`. -`FXQuote` is a class (so it can be subclassed if needed), which composes the exchange rate to be used. The rate is a `BankersDecimal` (see below on the decimal implementation details). +`FXQuote` is a struct, which composes the exchange rate and percentage commission to be used. Both properties are `BankersDecimal` values (see below on the decimal implementation details). ```swift public static func quoteFromNetworkResult(result: Result<(NSData?, NSURLResponse?), NSError>) -> Result { @@ -228,13 +228,13 @@ And of course if you have an IAP for purchasing in-app currency, then I’m sure Take a look at the example project, Custom Money, for an example of a custom local FX provider to exchange your 🐝s. ## Installation -Money builds as a cross platform (iOS, OS X, watchOS) extension compatible framework. It is compatible with [Carthage](https://github.com/carthage/carthage). It is also available via CocoaPods +Money builds as a cross platform (iOS, OS X, watchOS) extension compatible framework. It is compatible with [Carthage](https://github.com/carthage/carthage). It is also available via CocoaPods. ```ruby pod ‘Money’ ``` -At of writing there seems to be issues with the CocoaDocs generator for pure Swift 2 projects. This means that the project doesn’t have a page/docs in CocoaPods sites. +At of writing there are some issues with the CocoaDocs generator for pure Swift 2 projects. This means that the project doesn’t have a page/docs in CocoaPods sites, however they are available through Xcode. ## Architectural style Swift is designed to have a focus on safety, enabled primarily through strong typing. This framework fully embraces this ethos and uses generics heavily to achieve this goal. @@ -276,13 +276,13 @@ The `_Money` type composes a `_Decimal`. Its behavior is pro `NSDecimal` would be a better storage type for `_Decimal`, however it doesn’t have the full `NSDecimalNumberBehaviors` support that `NSDecimalNumber` enjoys. In particular, specifying the scale is problematic. If anyone has any smart ideas, please get in touch. I’ve added an equivalent extension on `NSDecimal` as for `NSDecimalNumber`. ### `ValueCoding` -Both `_Decimal` and `_Money` conform to [`ValueCoding`](https://github.com/danthorpe/ValueCoding) which means they can be encoded and stored inside archives. +Both `_Decimal`, `_Money` and `FXTransaction` all conform to [`ValueCoding`](https://github.com/danthorpe/ValueCoding) which means they can be encoded and stored inside archives. ## Author Daniel Thorpe [@danthorpe](https://twitter.com/danthorpe). -Feel free to get in contact if you have questions, queries, or need help. +Feel free to get in contact if you have questions, queries, suggestions, or need help. Especially get in contact via an Issue here or on Twitter if you want to add support for another FX service provider. I wrote an introductory blog post about money [here](http://danthorpe.me/posts/money.html). diff --git a/Supporting Files/Generate.swift b/Supporting Files/Generate.swift index efdf41d..25af364 100755 --- a/Supporting Files/Generate.swift +++ b/Supporting Files/Generate.swift @@ -28,6 +28,28 @@ func createFrontMatter(line: Writer) { line("// Money, https://github.com/danthorpe/Money") line("// Created by Dan Thorpe, @danthorpe") line("// ") + line("// The MIT License (MIT)") + line("// ") + line("// Copyright (c) 2015 Daniel Thorpe") + line("// ") + line("// Permission is hereby granted, free of charge, to any person obtaining a copy") + line("// of this software and associated documentation files (the \"Software\"), to deal") + line("// in the Software without restriction, including without limitation the rights") + line("// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell") + line("// copies of the Software, and to permit persons to whom the Software is") + line("// furnished to do so, subject to the following conditions:") + line("// ") + line("// The above copyright notice and this permission notice shall be included in all") + line("// copies or substantial portions of the Software.") + line("// ") + line("// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR") + line("// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,") + line("// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE") + line("// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER") + line("// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,") + line("// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE") + line("// SOFTWARE.") + line("// ") line("// Autogenerated from build scripts, do not manually edit this file.") line("") } @@ -37,7 +59,6 @@ func createCurrencyTypes(line: Writer) { line("") line(" /// Currency \(code)") line(" public final class \(code): Currency.Base, _CurrencyType {") - line(" /// Lazy static storage for currency.") line(" public static var sharedInstance = \(code)(code: \"\(code)\")") line(" }") } @@ -59,6 +80,10 @@ func generate(outputPath: String) { fatalError("Unable to create output stream at path: \(outputPath)") } + defer { + outputStream.close() + } + let write: Writer = { str in guard let data = str.dataUsingEncoding(NSUTF8StringEncoding) else { fatalError("Unable to encode str: \(str)") @@ -73,7 +98,6 @@ func generate(outputPath: String) { createExtensionFor("Currency", writer: writeLine, content: createCurrencyTypes) write("\n") createMoneyTypes(writeLine) - outputStream.close() } // MARK: - Main() @@ -84,5 +108,4 @@ if Process.arguments.count == 1 { } let outputPath = Process.arguments[1] -print("Will output to path: \(outputPath)") generate(outputPath) \ No newline at end of file diff --git a/Supporting Files/Money.xcconfig b/Supporting Files/Money.xcconfig index da46098..f8bd0c3 100644 --- a/Supporting Files/Money.xcconfig +++ b/Supporting Files/Money.xcconfig @@ -6,7 +6,7 @@ // // -MONEY_VERSION = 1.2.0 +MONEY_VERSION = 1.2.1 APPLICATION_EXTENSION_API_ONLY = YES INFOPLIST_FILE = $(SRCROOT)/Supporting Files/Info.plist