Xcode Tips and Tricks

Unofficial AI summary of the WWDC26 group lab. May contain mistakes.

What are the most useful Xcode tips and tricks that most people may miss out on?

  • Use the #Playground macro in any Swift file to run code snippets and see expression results, similar to a playground.
  • Cut text to move to a new file, focus on the file navigator, and paste to create a new file with the content. Xcode will guess the filename.
  • Use "Find Call Hierarchy" to quickly understand where a function is being called from, including nested calls.
  • Use Command-Shift-J to navigate to the current file's location in the project navigator.
  • Use Open Quickly (Command-Shift-O) to search for functions or files to quickly navigate the project.
  • Combine Command+Shift+J (reveal in navigator) with Open Quickly: find a symbol, then reveal its file location.

Which recent Xcode features deserve more attention?

  • Convert Xcode groups to folders (blue folders in the navigator) to significantly reduce project file conflicts, especially on large teams.
  • Folders do not record the list of files, leading to fewer diffs in the project file when adding new files.
  • Edit schemes to set different user defaults for testing specific features.
  • Filter the console output to debug more effectively by focusing on specific components or categories.
  • Use the filtering feature in many Xcode menus (including the jump bar) by typing to filter the menu items.
  • Pass arguments to SwiftUI previews to render multiple variants (e.g., light/dark mode, dynamic type sizes) in a single preview.
  • Open memory graph debugger .memgraph files in Instruments to see allocation timelines, which can provide more detailed memory footprint information than the memory graph debugger alone.
  • Use conditional breakpoints with specific conditions or repetition counts to trigger them only when needed, avoiding constant pausing.

What are the most underrated Xcode features that even experienced developers don't use enough?

  • Convert Xcode groups to folders to reduce project conflicts.
  • Different themes per workspace in Xcode 27 — set a distinct theme for each project to tell them apart at a glance.
  • Change the debug bar appearance to distinguish the debug Xcode from the daily-driver Xcode.
  • Pin tabs within the SwiftUI canvas to maintain previews while navigating other files.
  • Use Xcode Cloud for automated builds and deployments, simplifying workflows.
  • Leverage Xcode's powerful search capabilities, including regular expressions and symbol searches.
  • Combine the search field with the filter field in the find navigator for boolean-style searches.
  • Press Delete in the Find navigator to remove individual results and narrow scope.
  • Command+click disclosure triangles to collapse sibling groups in the navigator.
  • Use the type hierarchy queries (up to root and down to leaves) to understand protocol conformance and subtypes.
  • Utilize Instruments' profiling tools, especially flame graphs combined with top functions, for performance analysis.
  • Use the SwiftUI instrument template for specific SwiftUI performance debugging.
  • Save custom instrument templates for repeated profiling use cases.

What caveats should we be aware of when running Xcode 27 beta on the same machine with Xcode 26?

  • Running multiple versions of Xcode simultaneously on the same machine is supported.
  • Xcode 26 may not run on macOS Golden Gate — plan the xcode-select setup accordingly.
  • Xcode 27 offers an optional stricter project validation checkbox; be aware when opening projects across versions.
  • The primary visual difference might be theme customization, with one version appearing more colorful than the other.

What tips and tricks can minimize merge conflicts in .xcodeproj files without using third-party tools?

  • Convert Xcode groups to blue folders to significantly reduce project file size and conflicts.
  • Ensure blue folder targets align closely with the source code they contain to minimize project file entries.
  • When converting groups to folders, resolve any preflight errors first, commit those changes, and then complete the migration.
  • In the project inspector, check the "minimize cross-project references" option for projects created in the last several years to reduce project file size.
  • Manage build settings in .xcconfig files to keep them separate from the project file.
  • Use the help inspector in the build settings editor to find the exact name of build settings.
  • Copy build setting rows to easily get the key name for .xcconfig files.
  • .xcconfig files provide an audit trail, comments, and are easy to review in pull requests.

Are there any cool tricks with Markdown in Xcode, and are there any improvements on the source control side of things?

  • View Markdown files in rendered or source code form directly within Xcode.
  • Edit Markdown files seamlessly within the editor, including within agent transcripts or plans.
  • View rendered Markdown side-by-side with the source code using the canvas preview button.
  • Xcode's source control navigator has been re-engineered for better performance, especially with repositories containing millions of tags.
  • Xcode now uses red and green for diff colors, which can be customized in themes.
  • Feedback on source control features, like multi-select for stashes, is actively encouraged.

When a Swift Package Manager package updates its macros, Xcode requires manual re-approval. Can macro trust be pinned to a package identity instead of requiring re-approval on every update?

  • This is a specific use case that warrants filing feedback with details about the package and the workflow.
  • The team is surprised that trust is invalidated on every update and wants to investigate further.

Is there a way to open the terminal on the project root folder in Xcode?

  • Not directly, but developers can open Terminal and drag a file reference from the navigator into it to change the directory.
  • The file inspector now lists the "working copy relative path," which can be copied and pasted into the terminal.
  • Filing feedback for this functionality, similar to "Show in Finder," is recommended.

What are the most useful Xcode keyboard shortcuts?

  • Command-Shift-J: Show the current file's location in the project navigator.
  • Command-Shift-Y: Show and hide the debug area.
  • Control-Option-Command-G: Rerun the last test.
  • Command-Option-P: Refresh previews automatically.
  • Control-6: Open the rightmost element of the path control above the editor, allowing scoped "Open Quickly" within the current file.
  • Command-Option-Up/Down: Switch between implementation and header files in Objective-C.
  • Command-Shift-O: Open Quickly for navigating to symbols or files.
  • Command-Control-R: Launch without building.
  • Control-Backslash: Jump to the next diff in the current file.
  • Command-Backslash: Toggle comment for a line or selection.

What are the most common beginner mistakes in Xcode, and how do I avoid them?

  • Trying to learn all Xcode features at once; focus on essential tools like the source editor, inspectors, and navigators first.
  • For code signing, use automatic signing for most cases, as manual signing can be complex for beginners.
  • Customize the toolbar to simplify the setup and focus on frequently used controls.
  • Start with a new project and immediately see results on the right-hand side, or use playgrounds for quick experimentation.
  • Xcode 27 can create a blank project without the template modal for a faster start.
  • Use agents to help reorganize code, but review the results carefully.
  • Use source control (Git) from the start of any project, even for solo developers, as it's the best undo system.
  • Avoid profiling on the simulator; always profile on an actual device for accurate data.
  • Do not profile debug builds; compiler optimizations can skew results.
  • Adopt modern frameworks like Swift concurrency and SwiftUI.
  • Consider rewriting small open-source projects to learn Xcode and general programming concepts.
  • Watch code-along sessions to see tools integrated into workflows while learning new concepts.
  • Organize the project structure from the beginning, even for small projects, using folders.
  • Experiment in small contexts like sandboxes or playgrounds before organizing larger projects.

What are the most efficient workflows for generating and maintaining DocC documentation alongside active development?

  • Write documentation comments in the source files; they will appear in the documentation preview assistant.
  • Host a DocC archive as a static website for pull request reviews.
  • Use the documentation preview assistant to view rendered documentation.
  • Consider using agents to add documentation comments, but review them to ensure they don't reveal implementation details.
  • Write articles before releasing features to help internal developers learn them.
  • Images in documentation can be configured to automatically swap between light and dark mode.
  • DocC is open source; check its repository for implementation details.
  • Use the generative AI search feature on developer.apple.com to find resources on DocC.

Which settings or practices can improve build time significantly?

  • Use Command-Control-R (Run Without Building) when code changes are not needed for debugging.
  • Modularize the project into separate packages or frameworks to isolate changes and reduce rebuilds.
  • Use the build log's assistant editor to analyze the build timeline and identify performance bottlenecks.
  • Opt into build settings that warn about slow Swift expression type-checking and break down complex expressions.
  • Be cautious with script phases; ensure they only run when necessary and declare their inputs and outputs.
  • Consider explicit modules and Swift's private/internal import features to manage dependencies and reuse build products.
  • Consult Xcode forums for specific build performance use cases and problems.

How can Xcode previews load faster without waiting for simulator relaunches?

  • Ensure good overall build performance, as previews share build artifacts with the main build.
  • Once a preview is running, Xcode performs minimal work to reload the current source file and update the preview.
  • Modularizing the project can also improve preview load times by optimizing build performance.

For automatic code formatting, how can I integrate SwiftFormat into Xcode effectively?

  • Integrate SwiftFormat to run on build, on save, or as a pre-commit Git hook.
  • Running SwiftFormat as a pre-commit hook is less disruptive and ensures formatted code is committed.
  • Running SwiftFormat when a pull request is ready for review is also a good practice.
  • Filing feedback is recommended for specific workflow issues encountered when integrating SwiftFormat.

What are the most underutilized LLDB commands or breakpoint actions for isolating state changes without stopping execution?

  • Use breakpoint actions to "Play Sound" for audible feedback when a breakpoint is hit.
  • Use breakpoint actions to "Log Message" to print diagnostic information without pausing execution.
  • LLDB allows calling any LLDB command from breakpoint actions.
  • Conditional breakpoints can be set based on modifier keys (e.g., Shift key) to trigger at a precise moment without constant pausing.
  • Breakpoints can be configured to skip a certain number of hits before triggering.
  • The "Variables View" in LLDB is often more useful than the po command for inspecting scope values.
  • Use p/x in LLDB to print hexadecimal numbers, useful for debugging low-level code.
  • Intentionally pausing the program without a breakpoint can help identify where the program is stuck if logging is insufficient.
  • Breakpoint actions can be used to print debugging statements without committing them to the codebase.

Can Xcode show unused vars, properties, and functions?

  • Xcode shows warnings for unused variables because the compiler can reliably determine their lack of use within scope.
  • Public properties are not flagged as unused because their usage cannot be reliably determined due to their public accessibility.
  • Feedback is welcome for use cases where developers expect unused code to be flagged but Xcode does not.
  • "Find Call Hierarchy" can help identify callers of a function, but it's not a comprehensive solution for all unused code.
  • Third-party tools may offer more extensive unused code detection.

When should derived data be deleted, and what else fixes haunted builds?

  • Deleting derived data is not a superstition; it can resolve issues caused by build system race conditions or outdated build artifacts.
  • Xcode 27 adds a Delete Derived Data menu item for easier cleanup.
  • Common reasons for deleting derived data include build order dependencies between targets, disk space issues, or working around build system bugs.
  • Xcode 27 has improved build system reliability, reducing the need to delete derived data.
  • When developers frequently need to delete derived data, file a bug report with reproducible steps so the build system can be improved.
  • Swift build is open source; developers can examine its source code to understand build system behavior.
  • Other options when a build is "haunted" include using "Clean Build Folder" or disabling parallelized builds to identify missing dependencies.
  • When developers still find yourself deleting derived data, please provide feedback to help improve the experience.

Can Xcode show when agent context compression occurs?

  • Filing feedback for a compression indicator and a pause before editing mode is recommended.
  • Consider using "Plan Mode" to write artifacts to disk, making context persistent and accessible to the model.
  • Creating artifacts that can be referenced helps maintain context across sessions or when switching between models.
  • Be mindful that CLAUDE.md files loaded into context increase context size. Feedback on workflow impediments is highly valued.

How can signing and provisioning profile mismatches be mitigated in Xcode?

  • Avoid using distribution certificates for release configurations when debugging or using tools like Instruments, as they require debuggable builds.
  • Do not disable the "Code Sign Injects Base Entitlements" setting to work around issues.
  • Use automatic signing for local development.
  • Xcode Cloud handles signing automatically, simplifying CI workflows.
  • For local development, use regular signing for debug and release configurations; distribution signing is only needed for App Store uploads.
  • When developers encounter specific code signing issues, consult developer.apple.com/forums for community and engineer support.

How can Xcode code folding suppress noise and surface high-value logic?

  • File feedback detailing the desired workflow and what constitutes "visual noise" for the use case.
  • Organize source code by splitting definitions across multiple extensions or files to contain less critical code.
  • Explore Xcode's editor menu for code folding actions that might suit the workflow.