Building a Collection For SwiftUI (Part 1) - Mimicking Collections in SwiftUI

SwiftUI does not offer any full-featured collection component like UIKit does, merely smaller building blocks like stacks, lists and scroll views (as well as lazy stacks and grids newly introduced in iOS and tvOS 14). In isolation none of these components is a true competitor to UICollectionView but, combined together, they can be used to build pretty advanced grid and table layouts.

Read More

Building a Collection For SwiftUI - Introduction

UICollectionView has been an essential tool for Apple app developers since its introduction in iOS 6. Over the years it received a range of improvements and was ported to tvOS so that you can build layouts with the same formalism on both platforms. In iOS and tvOS 13 UICollectionView received the most significant enhancements ever made since its introduction, namely diffable data sources and compositional layouts.

Read More

Yet another article about method swizzling

Many Objective-C developers disregard method swizzling, considering it a bad practice. I don’t like method swizzling, I love it. Of course it is risky and can hurt you like a bullet. Carefully done, though, it makes it possible to fill annoying gaps in system frameworks which would be impossible to fill otherwise. From simply providing a convenient way to track the parent popover controller of a view controller to implementing Cocoa-like bindings on iOS, method swizzling has always been an invaluable tool to me.

Read More