
Apple’s Foundation Models framework gives iOS developers direct access to the on-device language model behind Apple Intelligence. But building a useful AI application involves much more than sending a prompt and displaying a response.
In this course, you will build a complete AI chat application using SwiftUI and the Foundation Models framework. You will begin by creating a basic language model session and then gradually develop the models, views, and services needed to support a complete chat experience.
You will use @Generable to create strongly typed responses and build a chat engine responsible for communicating with the model. You will then display user and assistant messages using a custom SwiftUI interface.
Next, you will extend the model with tools. You will create a reusable HTTP client and build a Movie Tool that searches the OMDb API. The language model will be able to recognize movie-related requests, invoke the tool, and use the returned information to generate its response.
As the application grows, you will discover an important challenge: a model with several responsibilities may not always choose the correct tool or behavior. To address this, you will build an intent classifier that identifies whether a request is a general question, a movie question, or a request for nearby places.
You will then create multiple Foundation Models sessions, each designed for a specific responsibility. This multi-step prompting approach gives you greater control over how requests are processed and helps keep tools isolated to the sessions that need them.
Finally, you will build a Place Tool using the user’s location and MapKit. The model will be able to search for nearby points of interest, and your SwiftUI application will display the results on a map.
By the end of the course, you will have built an AI chat application that combines SwiftUI, guided generation, tool calling, intent classification, multiple model sessions, networking, location services, and MapKit.
What You Will Learn
Create and configure a LanguageModelSession
Send prompts to Apple’s on-device language model
Generate strongly typed responses using @Generable
Design models for user and assistant chat messages
Build a chat engine for managing model interactions
Display a complete chat conversation with SwiftUI
Create a reusable networking layer with HTTPClient
Build a custom Movie Tool using the OMDb API
Register tools with a Foundation Models session
Understand how and when the model invokes tools
Build an intent classifier using Foundation Models
Route requests to specialized model sessions
Create separate sessions for general and movie-related requests
Access the user’s location
Build a Place Tool using MapKit
Search for nearby points of interest
Display locations using a SwiftUI map
Who This Course Is For
This course is designed for iOS developers who are comfortable with Swift and SwiftUI and want to build practical applications with Apple’s Foundation Models framework.
You do not need previous experience with machine learning, large language models, or AI development. The course focuses on using the Foundation Models framework from an iOS developer’s perspective.
Requirements
Basic knowledge of Swift
Familiarity with SwiftUI
Basic understanding of asynchronous programming in Swift
A Mac with a recent version of Xcode
A device that supports Apple Intelligence
An OMDb API key for the Movie Tool section
If you are ready to move beyond basic prompts and learn how to build an AI chat application with tools, routing, specialized sessions, location services, and maps, this course will walk you through the complete process.