Re: [swift-users] Parsing Decimal values from JSON

2017-10-31 Thread Rimantas Liubertas via swift-users
> > Swift shouldn't be forced to adhere to the limitations of JavaScript. Just > because JS doesn't know about decimals doesn't mean swift can't do better. > JSON does not know about decimals either. http://json.org/. If you need some custom data type you can always pass it as a string and then han

Re: [swift-users] Parsing Decimal values from JSON

2017-10-30 Thread Rimantas Liubertas via swift-users
> > It seems that the JSON decoder parses it as Double then converts it to > Decimal which introduces errors in the parsing. That behavior is in fact > incorrect. > Why do you say that? JS in JSON stand for JavaScript, and Javascript has now idea about neither Decimal nor Integer numbers. Best r

Re: [swift-users] JSON keys survey

2017-06-23 Thread Rimantas Liubertas via swift-users
> This has come up a few times in recent threads, and I wanted to gather > some additional info on your real world use cases. Just reply to me, and > any input is appreciated: > > 1. Does your JSON use snake_case_keys or CamelCase or other? > It depends on whether API is intended to be used with J

Re: [swift-users] Optional chaining and String properties

2016-08-01 Thread Rimantas Liubertas via swift-users
> > var s: String? = "Foo" > print(s?.characters) > > The result indicates that s?.characters is indeed an Optional instance, > indicating that s?.characters.count should be illegal. > > Why is s?.characters.count a legal expression? See print(s?.characters.count) — you get the optional des

Re: [swift-users] Are value semantics really appropriate in a diagramming app?

2016-08-01 Thread Rimantas Liubertas via swift-users
> Similarly, in the diagramming example from the WWDC videos, how would that > app handle the user editing existing Drawables in the Diagram? Let's say > you allow the user to click on a Drawable and drag it to another location > in the canvas. Is this reasonable: > See this talk too: https://deve

Re: [swift-users] Swift 3/Xcode 8 change: changes with string interpolation and implicitly unwrapped optionals

2016-07-20 Thread Rimantas Liubertas via swift-users
> Does anyone know why I have to unwrap the variable again during interpolation > in Xcode 8 with Swift 3? Is this is a possible Xcode 8 bug (I can file a > radar if it is) or a known change in Swift 3? > > https://github.com/apple/swift-evolution/blob/master/proposals/0054-abolish-iuo.md B