Re: [swift-users] JSON keys survey

2017-06-23 Thread Rien via swift-users
> On 23 Jun 2017, at 18:42, Tony Parker via swift-users > wrote: > > Hi all, > > 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

Re: [swift-users] intercept fatalError() or other termination messages from swift?

2017-06-23 Thread David Baraff via swift-users
Is it possible that Apple’s own xcode tools just don’t show you the string, but it’s there anyway? that seems pretty bogus… > On Jun 23, 2017, at 9:40 PM, Jon Shier via swift-users > wrote: > > Crashlytics can pick up these strings just fine. I thought they were part

Re: [swift-users] intercept fatalError() or other termination messages from swift?

2017-06-23 Thread Jon Shier via swift-users
Crashlytics can pick up these strings just fine. I thought they were part of the full crash dump. > On Jun 24, 2017, at 12:13 AM, David Baraff via swift-users > wrote: > > I realize this is slightly centric to iOS, but it irks me that both Apple’s > crash report logs

[swift-users] intercept fatalError() or other termination messages from swift?

2017-06-23 Thread David Baraff via swift-users
I realize this is slightly centric to iOS, but it irks me that both Apple’s crash report logs and popular platforms like PLCrashReporter can do the hard stuff like give you a stack trace, but are *completely* unable to display the error message from terminating a program via fatalError(), or

Re: [swift-users] Robust Codable coding

2017-06-23 Thread Kyle Murray via swift-users
Hi Howard, If I'm understanding your question correctly, you're asking: What happens if you remove, for example, the comment property in v2 of your Project structure? The way you've set things up lets you remove all references to comment in your code, and it can still exist as a key in old

[swift-users] Robust Codable coding

2017-06-23 Thread Howard Lovatt via swift-users
Hi All, I have started to use Codable and was looking for some advice. I want to make the persisted data structure robust so that if I change the properties as the code develops the new code can deserialise an old saved file. This is what I am currently doing: struct Project: Codable {

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

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread Randy Eckenrode via swift-users
I assume this issue affects other implementations of Encoder and Decoder as well. The most obvious way to represent a key with multiple types is an enum, but enums don’t have their conformances to Codable generated automatically. It’s possible to write your own, but it can get a bit ugly (e.g.,

Re: [swift-users] JSON keys survey

2017-06-23 Thread Matthew Johnson via swift-users
> 1. Does your JSON use snake_case_keys or CamelCase or other? I usually see snake_case or lowerCamelCase. They are roughly equally common in my experience. > 2. Is the key type consistent throughout the JSON? Usually. > 3. If JSONEncoder/Decoder converted these, would you have any other

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread Jon Shier via swift-users
Itai: No need to apologize, I do appreciate the difficulties of designing this entire feature as quickly and completely as was required. An intermediate JSON type would be a great fix, though most useful if it exists outside of JSONDecoder so it's useful for encoding as well. As long as it

Re: [swift-users] Applying MVC pattern to iOS Swift apps

2017-06-23 Thread Andreas Mayer via swift-users
> Am 23.06.2017 um 11:41 schrieb Roy Henderson via swift-users > : > Should controller functions be incorporated in the AppDelegate or is it > better to keep the AppDelegate minimal and put them in a separate controller > module? You start breaking up any controller if

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread Itai Ferber via swift-users
Hi Jon, I just joined this mailing list and have tried to catch up on the history of this thread, so please excuse me if I’ve missed something. I’m sorry the Codable API at the moment does not answer your needs — you’re clearly not the only one who’s run into this, so let’s see how we can

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread Jon Shier via swift-users
Your gist is extremely interesting to me. I had tried something similar with Argo’s existing JSON enum, but was somewhat stymied by trying to decode it from an unkeyed container. I suppose I still don’t have a good grasp on all of the existing container types. Jon > On Jun 23,

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread Jon Shier via swift-users
David: I never called the design silly (though I think it’s inadequate for some important usage and makes some strange decisions), I was referring to the fact that the (apparent) official solution can’t actually decode all of the JSON people use. It’s the same reason I brought up

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread Randy Eckenrode via swift-users
> On Jun 17, 2017, at 10:07 PM, Chris Anderson via swift-users > wrote: > > Say I have a JSON object such as: > > { > "id": "4yq6txdpfadhbaqnwp3", > "email": "john@example.com ", > "name":"John Doe", > "metadata": { >

Re: [swift-users] Applying MVC pattern to iOS Swift apps

2017-06-23 Thread Adrian Zubarev via swift-users
Well you are right this is not the right place for such questions, because this mailing list is about pure Swift topics. Think about MVC as MVVM where M = M, V = V and C = VM. Don't get confused by the `Controller` suffix, especially there is no `ViewController` suffix, because it

[swift-users] Applying MVC pattern to iOS Swift apps

2017-06-23 Thread Roy Henderson via swift-users
Firstly, my apologies for submitting a question which is perhaps not strictly on-topic but hopefully the list will permit me a little latitude. Thinking specifically of iOS Swift application design architecture I would be very interested to hear how other members map traditional MVC patterns to

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-23 Thread David Hart via swift-users
> On 23 Jun 2017, at 03:45, Jon Shier via swift-users > wrote: > > I’m sorry, are you complaining about my use of Codable instead of more > precisely referring to the JSON endcode/decode functionality based on it in > Foundation, or are you honestly trying to say