I think you have the wrong definition of pyramid of doom. These are not regular callbacks that might as well be asnyc. This is just a view hierarchy. When you debuf your UI you see the very same thing...
But you knwo what - I challenge you to recreate this UI in UIKit. I wonder how that turns out.
(Not that OP’s code needs no refactor, don’t get me wrong - it might. But having 5 levels of a view hierarchy is not that big of a deal.)
Why the challenge thing? Did I challenge anything? I just mentioned the pyramid thing which I agreed with.
Technically, it’s still a closure used with declarative UI purposes. Nothing against any of that, only readability difficulties when there’s too much indentation. But that’s just my opinion.
1
u/snaab900 Objective-C / Swift Mar 27 '21
Looks cool and all, but just look at those pyramids of doom in the code. Yikes.