|< What do you think are good use cases for enum raw values?||How to get involved in the Swift community >|
Recorded – watch the full episode on YouTube.
Is there any new Swift API you would like to incorporate into your work at New York Times?
Paola Mata: So something I'm thinking about now for a project that I'm working on is using diffable data sources.
Paul Hudson: Oh, yeah. Steve Breen’s work – so good!
Paola Mata: I haven't used it yet. And I think it'd be great because I'm running into a situation where we have a list, we're thinking a lot about making it editable. And I've been told that it would be a really good use case for it.
It can suck not being able to dive right into these things because they do have to support older versions. But I do keep an eye out for where can I make a case for using this new API or using this new feature.
“Diffable data sources do that for you. You just say, ‘here's my old data, here's the new one. Figure out the differences, please apply a snapshot,’ and boom, it'll reorder them animated live on the thing.”
Paul Hudson: It's a wonderful feature. And the example they gave actually on the WWDC stage was re-implementing the WiFi finder in iOS, where you see a few WiFi things, your local hotspot and new ones slide in and then go away again. So you'll just call out with the old ones, whatever. And it's constantly changing the list. You want to animate it and move around and go away again.
That kind of thing is difficult to do because you want to animate it nicely. You want the list to move up slightly and then reorder and insert here. And of course you can just call and we load data, but we don't want to do that one and make it nice and beautiful. Well, diffable data sources do that for you. You just say, “here's my old data, here's the new one. Figure out the differences, please apply a snapshot," and boom, it'll reorder them animated live on the thing. It just looks absolutely fantastic. So that's a good choice.
Paola Mata: Yes, I'm excited to get into it.
This transcript was recorded as part of Swiftly Speaking. You can watch the full original episode on YouTube, or subscribe to the audio version on Apple Podcasts.
SPONSORED ViRE offers discoverable way of working with regex. It provides really readable regex experience, code complete & cheat sheet, unit tests, powerful replace system, step-by-step search & replace, regex visual scheme, regex history & playground. ViRE is available on Mac & iPad.
Link copied to your pasteboard.