Closed irace closed 8 years ago
Yeah, I totally hear you on this.
It's used by the remote FX services stuff. e.g. Yahoo currency exchange. These are the options:
Essentially, my goals with Money were to write it in a week. It ended up taking two weeks, including the FX stuff. I was pragmatic and opted to use a dependency for the JSON parsing. Eventually I'm kinda thinking that this sort of thing will be worked out - I think I'm correct in thinking that cross dependency resolution will be part of SPM. So, in the grand scheme of things, especially regarding Swift, I was more focused on trying to write a clean API and not worry too much about how the sausage is made. Everything is subject to change.
However, if people are using Money especially on TV or Watch, I'd be happy to look into getting rid of the JSON & Result dependencies. One possible minimal effort option is to move the FX stuff into an extra module.
What do you think?
One possible minimal effort option is to move the FX stuff into an extra module.
This is the obvious solution in my opinion. Money
could be a lightweight formatting library with minimal dependencies. FX
could be a library with networking capabilities that depends on Money
.
I agree that FX could/should be moved into an extra module.
Okay, that's what I'll do.
Getting https://github.com/danthorpe/FX/issues/1 setup. But, first, it'll make sense to remove the dependencies & code from here. Especially SwiftJSON which is proving problematic for watchOS.
This has now been done as of version 1.5.1 of Money.
Perhaps not a huge deal but it does seem a bit weird for a money formatting library to depend on a JSON parsing library. Is this a necessary dependency? I presume this will mean that most apps that include
Money
end up including two JSON libraries in their applications, unintentionally.