Xcode 15 is now 50% smaller on the Mac App Store, with downloadable simulator runtimes for all platforms.
WWDC23 brought an exhilarating week for Apple platform developers, as Apple unveiled a plethora of exciting features for Xcode in the new Xcode 15. Let’s explore these features through their titles:
- Code Completion Prioritization: Xcode 15 prioritizes code completion based on surrounding code, offering the most relevant suggestions for modifiers, view customization, and more.
- Streamlined Localization Assets: The String Catalog provides a centralized and efficient way to review and update localization assets, ensuring accuracy and consistency.
- Enhanced Documentation: Enjoy a beautifully redesigned documentation interface in Xcode 15, complete with a real-time preview, making learning and reference browsing a seamless experience.
- Powerful Previews: Iterate on your UI effortlessly with Xcode 15’s improved Previews, providing instant feedback and customization options across different platforms and UI frameworks.
- Target-Specific #if Preprocessor Macros: Xcode 15 intelligently grays out `#if` paths that don’t apply based on your current compilation target, improving code comprehension and reducing confusion.
- Git Staging Integration: Git staging is now integrated directly into Xcode, allowing you to stage or un-stage changes with a simple click and craft your commits without leaving the code editor.
- Revamped Test Report: A complete redesign of the test report offers new tools for better understanding test results and taking appropriate action. Gain valuable insights, including common failure patterns.
- Lightning-Fast Linking: Experience up to 5x faster linking speed, optimizing your build times and boosting productivity. The new linker reduces debug binary size by up to 30%, saving disk space and improving build performance.
- Bookmark Navigator: Keep track of important code landmarks and effectively organize tasks with the new Bookmark navigator.
These exciting new features in Xcode 15 empower developers to streamline their workflows, optimize performance, and enhance their coding experience across the Apple platform.
Let’s provide examples to demonstrate each of these features.
Code Completion Prioritization
In Xcode 15, you will experience improved code completion that prioritizes the most relevant suggestions based on the surrounding code. This enhancement ensures that you receive accurate and timely suggestions, whether you are selecting the appropriate modifier for a specific view or chaining modifiers while customizing a view.
String Catalog
Xcode 15 introduces streamlined localization asset management through the new String Catalog, providing developers with a centralized and efficient way to review and update localization assets. The String Catalog serves as a dedicated hub where you can easily manage and maintain your localized strings. This centralized approach simplifies the process of reviewing and modifying localized content, enabling you to ensure accuracy and consistency across different languages.
Symbols for the Asset Catalog
Xcode now automatically generates symbols for your asset catalog resources. This means that these symbols will appear in code completion, making it effortless to utilize your assets within your code. By incorporating this feature, you can benefit from type safety and have peace of mind, knowing that your assets are readily available at runtime.
Preview and Swift Macros
Xcode’s previews offer a seamless way to iterate on your UI, providing nearly instant feedback as you design alongside your app’s code. With the advancements in Xcode 15, previews have become even more user-friendly and accessible. One notable improvement is the introduction of a new syntax, leveraging Swift Macros, which makes writing and remembering the syntax a breeze. Moreover, working with different platforms and devices has become easier as well. You can conveniently select the desired platforms and devices right in the canvas, ensuring that your views look exceptional across various screen sizes. Excitingly, Previews can now be utilized across all UI frameworks! Whether you’re using SwiftUI, UIKit, or AppKit, you can seamlessly iterate on your UI with a consistent experience, regardless of your code’s location.
Preprocessors Macros for the Selected Compilation Target
Xcode 15 introduces a cool feature where it intelligently grays out #if paths(Preprocessors Macros) that do not apply to your current compilation target. This means that if you are not targeting macOS, for example, Xcode will automatically gray out the #if path(Preprocessors Macros) specific to macOS. This visual distinction helps you quickly identify and differentiate between code sections that are relevant to your current target platform and those that are not.
By graying out the irrelevant #if paths(Preprocessors Macros), Xcode provides a clear visual indication of the code paths that are active and applicable for your current compilation target. This feature promotes better code comprehension and helps avoid confusion, ensuring that you focus on the relevant portions of your codebase.
This enhancement in Xcode 15 simplifies the process of working with conditional compilation directives, enabling you to understand at a glance which sections of code will be included or excluded based on your target platform. It enhances code readability and saves time by eliminating the need to manually navigate through conditional code blocks.
With Xcode 15’s improved handling of #if paths(Preprocessors Macros) and their visual representation, your development workflow becomes more efficient and seamless. You can confidently navigate and work with conditional code, knowing that Xcode will provide clear visual cues to help you stay focused on the relevant parts of your codebase.
Git Staging Integration
Xcode simplifies the process of reviewing and committing changes by integrating git staging directly into the interface. For those who incorporate git staging into their workflows, this enhancement proves invaluable. With just a click, you can effortlessly stage or un-stage any change, allowing you to craft your next commit without the need to navigate away from your code. The Source Control navigator provides a comprehensive view where you can review all your changes at once, facilitating a more efficient commit process. Additionally, Xcode goes a step further by displaying un-pushed commits, ensuring that you can synchronize your commits perfectly when creating a pull request. This integration streamlines the overall code management experience, empowering you to effectively organize and coordinate your commits without any disruptions.
Revamped Test Report
Now, let’s delve into the crucial aspect of testing. Testing plays a pivotal role in developing a high-quality app. As your codebase expands to encompass various platforms, devices, languages, and user features, effectively navigating your test results and identifying areas that require attention can pose challenges. However, Xcode 15 introduces a comprehensive redesign of the test report, equipping you with new tools to gain a deeper understanding of your results and take appropriate actions.
The revamp begins with a visually appealing results overview. This overview provides valuable Top Insights, including highlighting common failure patterns, such as those with the same assertion message. This allows you to quickly identify recurring issues and address them efficiently. By presenting this information in a more structured and accessible manner, Xcode empowers you to make informed decisions and prioritize your testing efforts effectively.
The new test report design in Xcode 15 assists in improving your testing workflow, enabling you to streamline the process of identifying and addressing any issues that arise during testing. With a clearer understanding of your test results, you can ensure the development of a robust and reliable app with confidence.
Lightning-Fast Linking
Xcode has undergone a complete redesign of its linker, resulting in significant improvements in link speed. The new linker has been built from the ground up, and the results are impressive — linking is now up to five times faster than before! This enhancement dramatically reduces the time required for the linking process, enabling developers to iterate and build their projects more efficiently.
Additionally, the redesigned linker brings about another significant benefit by reducing the size of debug binaries. Debug binaries are essential during the development process for debugging and troubleshooting purposes. With the new linker, the size of these debug binaries can be decreased by up to 30%. This reduction in size not only helps conserve disk space but also contributes to faster build times and smoother debugging experiences.
By revamping the linker, Xcode has made substantial strides in improving the overall performance and productivity of the development workflow. The faster link speeds and smaller debug binaries provided by the new linker greatly enhance the development experience, allowing developers to focus more on coding and less on waiting for lengthy build processes to complete.
In this context, there is another crucial feature worth mentioning: Mergeable Libraries. I will delve into this topic in a dedicated article, where I will provide a comprehensive explanation of its functionality and benefits. Stay tuned for the upcoming article where we will explore Mergeable Libraries in detail.
Bookmark Navigator
Maintaining organization in your codebase is crucial for efficient development, and Xcode offers a helpful solution with the introduction of the Bookmark navigator. The Bookmark navigator is a new feature designed to assist you in keeping track of landmarks within your code and effectively organizing your tasks.
With the Bookmark navigator, you can easily mark important sections or specific lines of code as bookmarks. These bookmarks serve as visual indicators, allowing you to quickly navigate to key areas within your project. Whether it’s a critical piece of logic, a TODO item, or a section that requires further attention, bookmarks provide a convenient way to mark and locate these landmarks in your codebase.
If there’s anything I overlooked about Xcode’s new features, I would appreciate it if you could add a comment below. Thank you for taking the time to read.
What’s New in Xcode 15 was originally published in Better Programming on Medium, where people are continuing the conversation by highlighting and responding to this story.