SwiftUI Defaults Considered Harmful

  • The webpage is nigh unreadable. A snowstorm, in March, over dark text on a dark background, with unstyled code.

    Look for the snowflake on the top right and click it to restore the default look.

  • The article is definitely wrong on the DSL being able to be replaced by some function call. You need to be able to do conditional rendering in a convenient way. The way SwiftUI’s DSL works means a lot of dynamic equality checks for updates can be statically resolved.

    Also in terms of magic values, Apple’s UI doesn’t have a fixed set of spacing values they choose from. They’ll have padding of 14px and 15px all over the place. It’s not practical to expect a developer to get them all right. And of course, this behaviour is easily disabled just by providing explicit values.

  • SwiftUI is excellent on iOS if you stay on the happy path. On macOS it needs a bit of work to get good results. It also has a built in escape hatch to UIkit when needed.

  • Past comments: https://news.ycombinator.com/item?id=22413355