4min chapter

Swift by Sundell cover image

107: “UIKit in 2021”, with special guest Ben Scheirman

Swift by Sundell

CHAPTER

Swift Closures

Swift closures can't just give these things names, right? If you're passing around a blocka, this is just a series of arguments. One pattern that i find very useful in those kinds of situations is to create a realay object. So it can be, for example, let's say you are building some kind of photo ap and you have like, a photo selection a u i,. which consistsof all those different smaller view controllers that each do one thing. You can create kind of a photo selection relay where all of those chalvew controllers can observe the current selection, and they can change it. To your point, we'd like neatly named methods, and

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode