I am trying to use the following library: https://github.com/peek-travel/swift-currency
One of the ways to use it is to do something like this to mean it is 5 dollars in USD:
USD(5.01)
I noticed that in one of my subviews, when I do this, I get the error of:
Compiling failed: missing argument label 'floatLiteral:' in call
Which I can fix by doing USD(floatLiteral: 5)
, which means the same thing.
Why is it that in some cases in my code I can do USD(5)
without an error, and in others I have to explicitly state the argument?
Documentation for USD from API reference is here: https://peek-travel.github.io/swift-currency/Structs/USD.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…