Claude has announced support for Apple's Foundation Models framework through a newly released Swift package. This integration enables developers to utilize Apple's framework to access Claude for handling more intricate workflows.
The Foundation Models framework facilitates seamless access to models directly from Swift, allowing developers to generate typed Swift values efficiently, often in just a few lines of code. This capability is particularly useful for on-device tasks such as summarization and data extraction.
Now, when developers encounter requests that require multi-step reasoning or code generation, they can hand off these tasks to Claude. Additionally, Claude can perform web searches for up-to-date information and execute code for data analysis, with responses streamed back into the same user interface.
Thanks to the framework's ability to return typed Swift values from @Generable annotations, developers can make clean API calls to Claude, avoiding the need to process raw user text.
The Foundation Models framework already supports various intelligent on-device features, including journaling apps that generate personalized prompts and document applications that summarize content. By integrating Claude, these functionalities can be significantly enhanced.
For instance, a journaling application can create daily prompts locally and then leverage Claude to identify themes across months of entries. Similarly, a study app can explain a term and pass the conversation to Claude for deeper inquiries.
This integration ensures a cohesive user experience, utilizing the most suitable model for each step of the process.
Starting tomorrow, Claude support will be available through Apple's Foundation Models framework on iOS 27, iPadOS 27, macOS 27, visionOS 27, and watchOS 27. Developers can incorporate this feature into their projects by signing in with an Anthropic API key and passing typed outputs from Apple's on-device capabilities into Claude requests. The package manages streaming, tool calls, and structured responses, making it easier to integrate into SwiftUI views.
What to Expect
- Easy integration with minimal code.
- Enhanced capabilities for complex reasoning and data analysis.
- Seamless user experience across various applications.
Next Steps for Developers
Developers interested in utilizing this new feature should prepare to update their projects and familiarize themselves with the Foundation Models framework to maximize its potential.