I really love this extension. It’s a fun thing you can do in Swift thanks to how flexible and extensible the language is, with a pretty obvious API surface. Any inset that’s not explicitly specified will default to zero, so it’s pretty hard to misuse.
Adam came up with the original idea of using key paths and a syntax that looks like this:
let insets: UIEdgeInsets = [\.top: 8, \.bottom: 8]
Daniel took it one step further and cleaned up the syntax to end up with the result we have above. Both are good choices, depending on how much you enjoy looking at keyPath literals.
Either way, you can’t go wrong, only .right. 😏