All articles
4 min·

Can Apple Intelligence replace a nutritionist? I built an app to find out

I built NutriScan, an iOS app that analyses meals with Apple Intelligence. An honest test: what works, what does not, and how OpenFoodFacts fills the gaps.

Par Carolane Lefebvre
Apple IntelligenceFoundationModelsSwiftUISwiftDataClaudeiOS
Can Apple Intelligence replace a nutritionist? I built an app to find out

TL;DR: I built NutriScan, an iOS app that analyses meals with Apple Intelligence (FoundationModels). The on-device model handles homemade meals well, but not packaged products. The fix: combine Apple Intelligence with OpenFoodFacts. Everything runs locally, no server, no account.


You see macro-counting apps everywhere. MyFitnessPal, Yazio, dozens of others. They estimate the calories, protein, carbs and fats of what you eat. And I always wondered: how does it actually work? Is it credible? And most of all, can you really trust an AI with what you put in your body?

So I decided to answer my own questions by building one. With a twist: Apple Intelligence, the Apple framework that runs a language model directly on the iPhone. No server, no API key, fully local and private.

Here is what I learned.

FoundationModels: Apple's local AI

Since iOS 26, Apple ships FoundationModels, a framework that gives you access to the on-device language model. You create a session, send a text prompt, and get a response back. Three lines of code:

let session = LanguageModelSession()
let response = try await session.respond(to: prompt)
let text = response.content

It is asynchronous, runs locally, and your data never leaves the phone. For a nutrition app where you describe what you eat, that is a huge privacy win.

The prompt I use asks the model to return a structured JSON with the meal name, calories, protein, carbs and fats. Parsing is done with JSONDecoder.

What works

For homemade meals, the results are reasonable. "A bowl of bolognese pasta with ground beef" returns values consistent with public nutrition tables. It is not gram-precise, but it is enough to get a sense of what you are eating.

Analysis takes about 2 seconds on an iPhone 15 Pro. No network wait, no spinner running for 10 seconds. Fast and smooth.

And critically: no data ever transits through a server. Everything stays on the device.

What does not work

The model is text-only. It cannot analyse a photo of your plate. That is a real limit: even if you snap a picture of your meal, you still need to describe it in text.

And for packaged products, AI estimation is pointless. Why ask a model to guess the calories of a chips bag when the real values are printed on the package?

The fix: OpenFoodFacts

To work around Apple Intelligence's limits, I integrated OpenFoodFacts into the app. It is an open database with nutritional information for millions of products. Free, community-driven, with an API.

Users can search a product by name or scan its barcode directly with the camera (via DataScannerViewController from VisionKit). The data returned are the actual nutritional values per 100g.

Result: Apple Intelligence for homemade meals, OpenFoodFacts for packaged products. The two complement each other.

The tech stack

NutriScan is built with:

  • SwiftUI for the UI
  • SwiftData for local persistence (the Model macro)
  • FoundationModels for on-device AI analysis
  • PhotosUI for image picking
  • VisionKit for barcode scanning
  • OpenFoodFacts API for real nutrition data

Everything was coded with Claude Code. The prompts I used are available for free on the Skool community.

The verdict

Can Apple Intelligence replace a nutritionist? No. It is a language model, not a nutrition table. It estimates, it does not measure.

But it is a useful tool. For quick, private daily tracking of what you eat, with no account, no subscription, no data sent to a server, it is an honest solution.

And remember, this is the V1 of FoundationModels. Once Apple adds vision support and stronger models, this kind of app will become genuinely powerful.

Resources


Carolane Lefebvre, indie iOS developer. I am building Keepio and I share everything I learn on @okeep_tv.

Commentaires

Connecte-toi pour laisser un commentaire.

Aucun commentaire pour le moment. Sois le premier !

More articles

.task vs .onAppear vs .refreshable en SwiftUI

iOS 26 a livré 5 améliorations discrètes en SwiftUI

safeAreaInset vs safeAreaBar en SwiftUI