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.
- Dec 2, 2026Meta Launches Muse Charm AI Gadget in the US for $299, With an Agent but No Calls
- Dec 2, 2026Canonical Releases Ubuntu 26.04 for RTX Spark Laptops with 128 GB of Shared Memory
- Dec 2, 2026The ncnn Author Ran MiniMax-H3 Without CUDA: a Step on an RTX 3060 Is 3.7x Faster
- Dec 2, 2026Anthropic Releases Claude for Apple Watch: Voice Chat Works on Any Plan
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.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
