< 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.
GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.
Link copied to your pasteboard.