Apple simplifies AI work in Swift with the @Generable and @Guide macros
Apple has shown how FoundationModels shortens the path from prompt to a ready-made data structure. The @Generable macro marks a Swift model as suitable for generation, while @Guide refines individual fields. The developer ends up with a stream of typed objects that can go straight into SwiftUI, with no manual parsing of the model's response. That cuts boilerplate code and makes integrating an LLM into an interface noticeably more practical.
AI-processed from Habr AI; edited by Hamidun News
FoundationModels for Swift now includes the @Generable and @Guide macros, which make it easier for developers to work with language models: instead of raw text from the neural network, developers get ready-made objects with the structure they need, which the compiler prepares automatically.
How do you use language models in Swift development?
Apple has added the @Generable and @Guide macros. The developer marks a data structure once, and the language model automatically creates ready-made typed objects instead of raw text.
How do you embed AI in a Swift app?
Use the @Generable and @Guide macros from FoundationModels. The developer marks a data structure, and the compiler prepares instructions for the language model, which returns ready-made typed objects instead of raw text.
What is the @Generable macro?
A built-in Swift tool that marks a structure as suitable for AI generation. The compiler prepares everything the language model needs to create instances of that type and deliver them as a stream.
What does the @Generable macro do in Swift?
@Generable marks a data structure as suitable for generation by a language model. The developer defines types and properties once, and the model returns ready-made objects on its own instead of raw text, while the compiler prepares everything needed to stream the instances.
- Nov 1, 2026Local models lose to Opus and Codex: 0.21 on a MacBook versus 1.00 for Codex
- Oct 29, 2026Claude Code Edits Video From a Transcript: How the video-use Skill With 30 000 Stars Works
- Oct 29, 2026Stanford AI tool verifies part of Signal's code in half a day for under $500, versus five months of expert work
- Oct 29, 2026Liquid AI releases LFM3: six multimodal 2B models with a 256K context window
Key Questions Answered
How do you use language models in Swift development?
Apple has added the @Generable and @Guide macros. The developer marks a data structure once, and the language model automatically creates ready-made typed objects instead of raw text.
How do you embed AI in a Swift app?
Use the @Generable and @Guide macros from FoundationModels. The developer marks a data structure, and the compiler prepares instructions for the language model, which returns ready-made typed objects instead of raw text.
What is the @Generable macro?
A built-in Swift tool that marks a structure as suitable for AI generation. The compiler prepares everything the language model needs to create instances of that type and deliver them as a stream.
What does the @Generable macro do in Swift?
@Generable marks a data structure as suitable for generation by a language model. The developer defines types and properties once, and the model returns ready-made objects on its own instead of raw text, while the compiler prepares everything needed to stream the instances.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.