Highlight
Xcode 27 upgrades coding agents from a single conversational assistant into a collaborative tool woven through the entire development flow. They support project exploration, plan mode, code generation, preview validation, test writing, parallel orchestration, and more, while keeping developers in control of the creative direction.
Core Ideas
From exploring a project to building a knowledge base
(00:56) When you join a new project, understanding the code structure is often the slowest first step. Xcode coding agents can see the whole project context, including source code, build settings, open files, and the currently selected code range, then generate a structured project tour.
That tour includes a data-flow overview, tables of key areas, and source links. You can click links to jump directly to files, or ask the agent to save the tour as architecture documentation inside the project, turning it into a shared dynamic knowledge base for the team.
(04:15) When you need to research an unfamiliar API, the agent can call the Apple Document Search tool and retrieve current official documentation instead of relying on stale training data. That means guidance for SwiftUI Table usage or SwiftData relationship modeling reflects the current version.
Plan mode: align first, then write code
(07:44) Xcode 27 adds plan mode. Type /plan in a conversation, and the agent first discusses the implementation approach with you, then generates a Markdown plan document. It writes code only after you confirm.
Plan mode addresses the problem where agents can generate code quickly but drift in the wrong direction. During planning, you can queue follow-up requirements, and the agent processes them after its current task. The agent can also ask clarifying questions, such as which metrics to show or which chart type to use. That back-and-forth makes the final solution closer to your real intent.
(10:09) After you confirm the plan, the agent starts implementation. Every code change appears as a diff in the artifacts panel. The agent automatically calls Xcode build tools to verify that the code compiles, iterates on build errors, and renders SwiftUI Preview when finished so you can inspect the UI directly.
Fine-tuning with sketches, inline annotations, and previews
(14:40) Agent-generated code is only a starting point. Visual polish still needs your input. Xcode supports three ways to communicate design intent:
- Image attachments: Upload a hand-drawn sketch or reference image, and the agent generates matching UI code.
- Inline annotations: Select a line in the code editor and add a note describing the requested change. The annotation carries precise code-location context, so the agent modifies only the annotated area and does not disturb unrelated code.
- Live previews: The agent continuously renders Preview during changes, forming a generate-preview-adjust validation loop.
In the demo, the presenter first drew a line-chart sketch in Freeform on iPad and uploaded it. The agent generated matching Swift Charts code. Then he added two inline annotations in the chart code: add a fade-in animation and adjust the trend-line color. The agent changed only those two areas and left the rest of the code untouched.
Parallel orchestration: multiple sessions moving at once
(18:54) Xcode 27 supports multiple independent conversations running at the same time, each executing a different task. In the demo, the presenter starts two conversations simultaneously:
- Localization: Translate all user-visible strings in the app into Filipino and configure Strings Catalog automatically.
- Accessibility: Add VoiceOver labels and accessibility identifiers to every interactive element.
Agents in each conversation automatically discover and use the right tools. The localization task is split into multiple subtasks and processed by sub-agents in parallel. The accessibility task traverses the view layer and adds labels. The two workflows run independently without interfering with each other. When they finish, the app has both multilingual support and complete accessibility support.
Details
Xcode tools available to agents
(18:54) Xcode provides agents with a toolkit that they discover and call based on the task:
| Tool | Purpose |
|---|---|
| Apple Document Search | Search current official documentation and get accurate API information |
| Build | Compile the project and verify code correctness |
| Preview Rendering | Render SwiftUI Preview and verify UI results |
| Run All Tests | Run the test suite, including tests newly written by the agent |
| Machine Translation | Automatically translate user-visible strings |
| Custom tools | Developer-provided tools that agents can call |
Developers do not manually choose these tools. The agent matches tools to the current task: Document Search when researching APIs, Build after generating code, and Preview Rendering when the work involves UI.
Conversation interface structure
(05:07) Each agent conversation has two columns:
- Left transcript: Shows the conversation history, including progress notes, tool calls, sub-agent status, and more.
- Right artifacts: Shows the agent’s generated files, code diffs, previews, and other outputs.
You can inspect only the latest message’s artifacts or review all artifacts across the entire conversation. Code changes appear as diffs, and new files appear directly in the project.
Example of using inline annotations
(17:01) Inline annotations work like this:
// Select the following lines in the code editor and add the annotation:
// "Add a subtle fade-in animation here"
Chart {
ForEach(workoutData) { data in
LineMark(
x: .value("Date", data.date),
y: .value("Volume", data.volume)
)
.foregroundStyle(.blue) // Annotation: "Change this to match our app theme"
}
}
Key points:
- Inline annotations attach to specific code lines, so the agent can locate the requested change precisely.
- Annotations carry surrounding code as context, helping the agent understand the semantic environment of the change.
- The modification scope is limited to the annotated area and does not spread into unrelated code.
- This is useful for fine-tuning known details such as color, animation, and copy.
How parallel orchestration works
(19:38) In orchestration mode, the main agent plans while sub-agents execute:
Main conversation: "Localize the app into Filipino"
|
+-- Discover the Machine Translation tool
|
+-- Split the task:
+-- Sub-agent A: Translate the Workout view
+-- Sub-agent B: Translate the History view
+-- Sub-agent C: Translate the Insights view
+-- Sub-agent D: Configure Strings Catalog
Key points:
- The main agent reads tool descriptions and understands capability boundaries.
- The task is split into subtasks that can run in parallel.
- Each sub-agent independently calls translation tools for its own section.
- Developers can view the progress of each task at any time.
Practical Ideas
1. Use agents to generate project architecture documentation
What to do: Ask the agent to analyze the project structure and generate ARCHITECTURE.md as onboarding documentation for the team.
Why it matters: The agent can see the full project context, so the generated document can include data flows, key file references, and module relationships more accurately than manually maintained docs. When the agent later changes code, it can update these docs too.
How to start: Open a new conversation and use a prompt like: “Summarize this project’s data models, view hierarchy, and architecture. Then create two markdown documents in the project root documenting the findings.”
2. Use plan mode to design new features
What to do: Before implementing any new feature, use /plan to have the agent produce a detailed solution document.
Why it matters: Agents generate code quickly, but they can drift. Plan mode separates “align on intent” from “write code,” reducing rework. In the demo, the agent asked about data presentation and ultimately chose both a “view by sport” and a “top-level summary” view.
How to start: Type /plan in an agent conversation and describe the feature goal, constraints, and acceptance criteria. Discuss for a few rounds, confirm the plan, and then move into implementation.
3. Use parallel conversations to handle technical debt in batches
What to do: Start multiple conversations at once, each handling an independent task such as localization, accessibility, or code refactoring.
Why it matters: In the demo, localization plus accessibility would have taken hours manually, but two parallel conversations completed the work in minutes. Sub-agents split the work and execute in parallel, improving throughput significantly.
How to start: Create a conversation for each independent task and describe the high-level goal. The agent discovers the right tools and coordinates execution automatically.
4. Iterate UI quickly with hand-drawn sketches and agents
What to do: Draw a UI sketch on iPad, attach the image or screenshot to the agent, and ask it to generate matching code.
Why it matters: The cycle from “imagining the UI” to “seeing it run” drops from hours to seconds. The agent can generate multiple preview options, and you can choose the best one before refining it.
How to start: Attach an image, such as a sketch or reference, in the agent conversation and prompt: “Add a line chart to InsightsView matching the style in this sketch.”
5. Let agents write and run tests
What to do: After finishing a feature, ask the agent to write unit tests for the new code and run verification.
Why it matters: In the demo, the agent wrote 12 test cases for new SwiftData models, and all passed. The agent can see the structure of the existing test suite and match its style.
How to start: Use a prompt like: “Write unit tests for the SwiftData model changes and run the test suite to verify.”
Related Sessions
- 227 - Create UI Prototypes using Agents in Xcode - A deeper look at collaborating with agents on UI design through sketches, inline annotations, and previews
- 213 - Translate your app with agents in Xcode - A focused session on agent-driven localization workflows
- 258 - What’s new in Xcode - An overview of the broader new features in Xcode 27
- 262 - What’s new in Swift - SwiftData and SwiftUI updates used alongside the examples in this session
- 267 - What’s new in Swift Testing - A detailed look at how agents write and run tests automatically
Comments
GitHub Issues · utterances