Reusable iOS SDKs, Facade, and Flow logic with Delegates and Closures | iOS Dev Live Mentoring

  Рет қаралды 25,577

Essential Developer

Essential Developer

3 жыл бұрын

Learn how to design and develop reusable iOS SDKs used by multiple apps, hide internal details and complexity from clients behind a simplified public interface (Facade), and handle flow logic with delegates and closures.
Join the iOS Lead Essentials program iosleadessentials.com
Like and share this content with someone that you believe will benefit from it. See you in the next episode.
---
How to Build iOS Apps with Swift, TDD & Clean Architecture series↴
www.essentialdeveloper.com/pr...
Caio & Mike's Book Suggestions ↴
www.essentialdeveloper.com/bo...
---
Subscribe to our channel ↴
kzfaq.info...
You can also find us on ↴
Twitter ☛ / essentialdevcom
Facebook ☛ / essentialdeveloper
Instagram ☛ / essentialdeveloper
LinkedIn ☛ / essentialdeveloper
Caio ↴
Twitter ☛ / caiozullo
LinkedIn ☛ / caiozullo
Mike ↴
Twitter ☛ / mrmichael
LinkedIn ☛ / mapostolakis
Join the iOS Lead Essentials program ↴
iosleadessentials.com
Visit our website ↴
essentialdeveloper.com

Пікірлер: 21
@ninini1928
@ninini1928 3 жыл бұрын
Returning a view controller is a great way. As you said client can handle how to show the payment. Thank you.
@afiqhamdan1425
@afiqhamdan1425 3 жыл бұрын
thanks for great video!
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Glad you liked it!
@madhurjain90
@madhurjain90 3 жыл бұрын
You guys are really doing great.
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Thank you, Madhur!
@ramanbhatia7552
@ramanbhatia7552 3 жыл бұрын
Excellent coverage of a topic that's at the back of every iOS developers mind! I have tried different approaches to this problem, but this is the cleanest I have found! A small request - would you be so kind as to publish the source code that you white boarded to illustrate the proposed solution during this Q and A session? Thanks so much!
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Thanks, Raman! Glad it was helpful. The source code is not publicly available, but it should be easy to replicate it ✅
@smilebot484
@smilebot484 3 жыл бұрын
You have to return your container controller to the client. That way internally you use your container.
@StefanoMartinallo
@StefanoMartinallo 3 жыл бұрын
Hi guys, around 32:30 you say the Payment Flow class is easily testable. Can you provide a hint on how to do it? Thanks a lot for these contents. You guy are doing great.
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Hi Stefano! We show how to test-drive many kinds of components in this playlist: www.essentialdeveloper.com/professional-ios-engineering-series
@ninini1928
@ninini1928 3 жыл бұрын
Whats the best way to go through the legacy code and understand the flow when there is no documentation present for the same? How can we start with documentation as we go through the code... Please share the link if u have already covered this topic.... Once again thanks a lot for your time and great way of spreading knowledge
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Here are 3 short videos about it 👇 kzfaq.info/get/bejne/ra2gpqtlldnJd4U.html kzfaq.info/get/bejne/as1ggbKeqdaciGQ.html kzfaq.info/get/bejne/ZtN2f5Of2LXFhYU.html
@souhailmarghabi4113
@souhailmarghabi4113 3 жыл бұрын
Great content. I am wondering about how to handle inter-dependencies between feature modules. let's say all features require an OAuth authorisation service or some features process on the same data layer/Objects?
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Hi Souhail, it depends on what you're trying to achieve. If you want to maintain the modules decoupled from authorization, you can invert the dependency with an abstraction and implement it with a Decorator or an Adapter, for example. This way, you can inject authorization into the modules without modifying them. But it depends on what you want to achieve.
@pablonavas7450
@pablonavas7450 Жыл бұрын
😊
@luvlore6904
@luvlore6904 3 жыл бұрын
Not sure to 100% get what's the difference between the Flow class and a Coordinator? You said the flow doesn't have a child or parent, but then you need to keep a reference to the Flow class somewhere too right? So it's retained?
@EssentialDeveloper
@EssentialDeveloper 3 жыл бұрын
Hello! There are many other ways to keep it in memory without a child/parent model. For example, the view controller can hold it indirectly - so the flow is retained just as long as the view controller.
@Nick6661992
@Nick6661992 Жыл бұрын
@@EssentialDeveloper What does it mean to hold indirectly? Keeping a delegate reference as strong? Seems confusing and unintuitive to me, as most of iOS developers expect the delegate to have a weak reference. Actually, I would argue that the whole point of a delegate pattern is maintaining parent- child relationship without creating a retain cycle, using an interface as a strategy. So I don’t get the reasoning behind this demo. You try to solve a problem by creating a new ‘hidden’ problem. A better solution seems to be a closure, which then the client can determine the type of reference, seems more understandable to me. But then, many closures can be very much unreadable and hard to reason about.
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Hi Niko! Indirectly means through any kind of indirect reference, such as a protocol, closure, or object association. So, no, you don't need to make the delegate strong. We do it with closures instead of delegates. But if you want to do it through weak delegates, you could use `objc_setAssociatedObject` to indirectly connect both objects. Moreover, there's nothing wrong with strong delegates. You can even find them in the Foundation framework. For example, the URLSession delegate is a strong reference. You can also combine them directly if you want to - we just mentioned that you *don't* need to - it's a choice. (Although maintaining parent/child relationships within Coordinators creates a much bigger problem: a lot of complexity to manually keep them in sync to avoid memory issues. You end up replicating the UIViewController parent/child relationship everywhere - which is unnecessary in most cases). Again, it's a choice - there's no absolute answer - and we want to share different ways of doing things so you can choose the best option depending on the current requirements.
@Nick6661992
@Nick6661992 Жыл бұрын
@@EssentialDeveloper I agree. Thank you for your enlightenment
@davidodia4603
@davidodia4603 3 жыл бұрын
There was an obvious knowledge gap between the guest and host, that initially made the show boring. But i guess that's how we all learn.
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 72 МЛН
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 10 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
ВОДА В СОЛО
00:20
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 35 МЛН
Careful With “Singleton” Lookalikes (WAY TOO COMMON)
33:12
Essential Developer
Рет қаралды 16 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 230 М.
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 72 МЛН