SwiftUI is Declarative. What Does That Mean?

andrewcbancroft

Andrew Bancroft

Posted on June 13, 2019

SwiftUI is Declarative.  What Does That Mean?

“Declarative” is one of Swift UI’s four core principles.

Aside from taking for granted that declarative is just “better” than whatever else, how about a visual to understand the declarative way of thinking?

Imagine yourself in a restaurant (sit-down or fast food, whichever).

When you want a burger, which best describes what you do?

Burger Imperative

or…

Burger Declarative

Saying what you want (aka, being “declarative”) is what the most probable thing you’d do in a restaurant.

That’s exactly the recipe you use when you’re working with SwiftUI.

In Summary

Burger Declarative Animation

💖 💪 🙅 🚩
andrewcbancroft
Andrew Bancroft

Posted on June 13, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related