Chapters

Hide chapters

Apple Foundation Models

First Edition · iOS 26.5 · Swift 6.3 · Xcode 26.4

Section I: Apple Foundation Models

Section 1: 9 chapters
Show chapters Hide chapters

Welcome to Apple Foundation Models — your introduction to building intelligent, on-device AI experiences using Apple’s new Foundation Models framework. As you progress through this book, you’ll explore the rapidly evolving world of large language models (LLMs) and discover how SwiftUI developers can integrate powerful generative capabilities directly into their applications. From building conversational interfaces and managing model sessions to guided generation, external tools, and on-device machine learning workflows, this book serves as your practical guide to modern AI development on Apple platforms.

Your journey will extend far beyond theory. Each chapter walks through real SwiftUI implementations, demonstrating how to interact with Foundation Models in practical applications while addressing the unique challenges that accompany AI-powered development. You’ll learn how to work within context windows, persist conversations, engineer effective prompts, and handle the limitations and unpredictability of language models responsibly. Along the way, you’ll explore advanced capabilities such as generating strongly typed data, dynamically constructing schemas at runtime, and integrating external data sources to expand model usefulness.

As the book progresses, you’ll bring these concepts together through the construction of complete on-device AI applications. You’ll work with audio capture, speech-to-text conversion, summarization, and intelligent tagging systems powered entirely by Apple’s on-device technologies. Whether you’re an experienced Swift developer exploring Apple Intelligence for the first time or an AI enthusiast eager to build practical SwiftUI applications, this book will provide the knowledge and hands-on experience needed to confidently work with Foundation Models. Prepare to experiment, iterate, and discover the possibilities of building intelligent apps directly on Apple devices.

How to Read This Book

This book is designed to introduce you to Foundation Models and its integration into SwiftUI applications in a practical, approachable manner. While no prior experience with large language models is required, a working understanding of Swift and SwiftUI will help you move comfortably through the material.

The chapters are organized to gradually build your understanding, beginning with foundational concepts such as LLM terminology and on-device model limitations before moving into more advanced topics like guided generation, dynamic schemas, and tool integration. Because of this, it’s a good idea to work through this book sequentially.

Because this subject is highly practical, you will benefit most from following along in Xcode as you read. Experimenting with prompts, modifying sessions, testing guided generation, and building the accompanying SwiftUI projects will deepen your understanding considerably. Many of the concepts explored in this book reveal their strengths and limitations only through experimentation, iteration, and observation.

Most importantly, approach the material with curiosity. Foundation Models represent a rapidly evolving area of development, and part of mastering them involves learning how to adapt, refine, and think critically about the behavior of intelligent systems. Each chapter is designed to help you build both technical proficiency and the practical intuition needed to create thoughtful, reliable AI-powered applications.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2026 Kodeco Inc.