Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Using a variable for multiple currencies #90

Open
tplester opened this issue Feb 7, 2018 · 0 comments
Open

Using a variable for multiple currencies #90

tplester opened this issue Feb 7, 2018 · 0 comments

Comments

@tplester
Copy link

tplester commented Feb 7, 2018

I have an app where the user selects one of a set of regions for the app to run in and all the money amounts need to use the currency for that region. I can't work out how to have variables that can be set to any of the strongly typed currency types (e.g. AUD, NZD) since Swift disallows the use of runtime defined Generics types. If I use Money type and force it to a specific currency, its fine until I do any operations that generate a new Money object (such as adding two Money objects), which causes the new Money object to be set to local region instead of the forced region I was using.

I'm using the Swift 4 branch.

Any Ideas on how to do this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant