DEV Community

Cover image for SwiftUI is Declarative.  What Does That Mean?
Andrew Bancroft
Andrew Bancroft

Posted on • Originally published at andrewcbancroft.com on

3 2

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

Heroku

Amplify your impact where it matters most — building exceptional apps.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay