Adapters in Swift

Any professional software developer knows that the simplest solution in building software is sometimes just to wrap an existing solution with the expected client interface and be done with it. This pattern is so common they even gave it a name, Adapter Pattern.

Simple UIViewController Transitions

When it comes to UIViewController transitions there are many articles and videos out there that talk more in depth about the sophisticated solutions provided by UIKit and that is probably for the good reason that those UIKit APIs are very complicated to understand. But UIKit also provides a simpler API for simpler needs. And I think nobody talks enough about it either because it is so simple that everyone assumes that everyone knows how it works or that it “just” works somehow that nobody cares about the details of how it’s intended to be used.

Data-Driven UI with UIKit

Preserving the theme of simplicity let’s make use of one of my favorite method from UIKit - layoutSubviews and build a data driven UI system.

Swift async-await vs closures

Swift await works by capturing the context and suspending the execution until the called async method returns. Another thing that works similarly by capturing the surrounding context is an escaping closure. So async-await calls can be imagined as equivalent to escaping closure. Whenever you see a method with async mentally replace that method with a escaping completion handler.