NEW: Learn to build the incredible iOS 15 Weather app today! >>

What new Swift API would you most want to see in your projects?

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.

Listen on Apple Podcasts

Hacking with Swift is sponsored by Essential Developer

SPONSORED Learn the most up-to-date techniques and strategies for testing new and legacy Swift code in this free practical course for iOS devs who want to become complete Senior iOS Developers.

Learn more

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift (Vapor Edition) Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Server-Side Swift (Kitura Edition) Buy Beyond Code

Was this page useful? Let us know!

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.