Just Do Swift

Just Do Swift

Build Swift Apps That Don’t Break: The Power of Structured Outputs

How schema-driven AI brings type safety, reliability, and real-world usability to your app.

Peng Ge's avatar
Peng Ge
Jun 22, 2025
∙ Paid

When "just chat" isn't enough: incorporating smarter AI into real applications

The quickest way to utilize a large language model? Put it behind a chat window, label it an "AI Assistant" and call it a day.

All you have here is a basic Q&A machine. The user types a question. The model returns its answer. Done.

But this is not what you are building.

Your app has a goal—a pain point, a real domain, a reason to exist.

You are attempting to solve something specific for your users.

You don't want an open-ended interaction.

You want a service or tool that just works.

And this is where almost everyone hits the wall.

Why "just let the AI talk" fails

If you have used models like GPT then you have seen: "prompt engineering" is not just a nice-to-have—it is the entire game.

You write prompts that creatively nudge, coerce and sometimes wrangle the model into compliance.

Initially, it feels clever. You say: "You are an XYZ assistant. Return the answer as json format".

This usually works.

Until you receive stray newlines, or lovely triple backticks, or some cryptic ```json at the beginning of returned text.

Humans are good at ignoring noise. Machines choke.

Keep reading with a 7-day free trial

Subscribe to Just Do Swift to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Just Do Swift
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture