• Heavy usage of the delegate pattern • Historical baggage (from springs & struts to Auto Layout etc.) • Retroactively fits modern conveniences/APIs • Written before Swift was introduced
Driven by highly imperative code • Heavily delegate based • Forces centralized UITableViewCell setup code • Requires considerable setup for to work with Auto Layout • Soul-sucking clusterf***
“what”, not the “how” • Decentralize responsibility across smaller, interchangeable units • Turn business logic into a function of data - generic UI components
from the “how” • Invert traditionally centralized APIs using protocols to diffuse responsibility • Think in terms of a generic scope, don’t make any assumptions • Make heavy use of generic parameters
usage of protocol-oriented programming (UILayoutGuide could be a protocol!) • Generic parameters for dependency injection (for e.g. appearance classes etc.) • Value types???
creating a generic UITableViewCell UI descriptor - cell descriptors must still vend a UI subclass • Generic type parameters over type erased protocol existentials • Associated types over simply using Array
• Design has evolved • Applications have become increasingly complex • Apple needs to maintain legacy code/support • Based on AppKit and NeXTSTEP • Written in Objective-C
Separation of concerns exemplified (model and rendering completely separate) • Composable widget architecture, conceptually simple • Built with a fresh, modern perspective - does not suffer from historical constraints