How senior iOS devs eliminate nested closures (arrow anti-pattern) in Swift | Live Dev Mentoring

  Рет қаралды 15,569

Essential Developer

Essential Developer

Жыл бұрын

Have you ever seen nested Swift closures shaped like an arrowhead (aka Pyramid of Doom)? 😱
Code shaped as an arrowhead is an anti-pattern caused by many nested structures such as nested conditions, switch statements, and even closures.
So watch this mentoring session now to learn how to eliminate nested closures (with & without Swift's async/await) to make code easier to read and maintain.
Get the source code at github.com/nativeiosdevelopme...
Join the iOS Lead Essentials program iosleadessentials.com
Like and share this content with someone that you believe will benefit from it.
---
Subscribe to our channel ↴
kzfaq.info...
You can also find us on ↴
Twitter ☛ / essentialdevcom
Facebook ☛ / essentialdeveloper
Instagram ☛ / essentialdeveloper
LinkedIn ☛ / essentialdeveloper
Telegram ☛ t.me/essentialdeveloper
Caio ↴
Twitter ☛ / caiozullo
LinkedIn ☛ / caiozullo
Mike ↴
Twitter ☛ / mrmichael
LinkedIn ☛ / mapostolakis
Visit our website ↴
essentialdeveloper.com
How to Build iOS Apps with Swift, TDD & Clean Architecture series ↴
www.essentialdeveloper.com/pr...
Caio & Mike's Book Suggestions ↴
www.essentialdeveloper.com/bo...

Пікірлер: 7
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Sign up to gain FREE access to exclusive iOS dev courses, workshops, and mentoring sessions: www.essentialdeveloper.com/community?
@EvgeniiBondarev
@EvgeniiBondarev Жыл бұрын
Double clicking on a brace helps to find its counterpart really quickly and reliably. Nice little Xcode feature that would simplify the process a little bit. Really nice job with a satisfactory result, guys!
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Thanks!
@awais.fayyaz
@awais.fayyaz Жыл бұрын
Hi Caio, Mike, and Bogdan, Thank you very much for sharing this video here on youtube. It really was a pyramid of Doom but you showed us two ways to make it better. Thanks. I have one question, though: How did you come to know about 'withCheckedThrowingContinuation' and that it can be used here?
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Glad you liked it! This method was introduced along with async/await - it was presented in a WWDC session. You can learn more about it here: developer.apple.com/documentation/swift/withcheckedthrowingcontinuation(function:_:)
@nameless6990
@nameless6990 Жыл бұрын
Can we use dispatch work items to solve this problem as well🤔
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Hi! You could but we don't think it wouldn't make the code easier to read.
Swift: Keychain Introduction (2022) - iOS
17:43
iOS Academy
Рет қаралды 26 М.
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 15 МЛН
UNO!
00:18
БРУНО
Рет қаралды 2,7 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 22 МЛН
Better Swift Closures Explained - Swift Tips (2023) - iOS
6:02
iOS Academy
Рет қаралды 7 М.
Multithreading and Concurrency in iOS apps | iOS Dev Live Mentoring
35:40
Essential Developer
Рет қаралды 8 М.
Composable Code Can Be Simple - Intro to dependency diagrams and composition
18:35