Xcode 16 Announced
Discover the latest productivity and performance improvements in Xcode 16. Learn about enhancements to code completion, diagnostics, and Xcode Previews. Find out more about updates in builds and explore improvements in debugging and Instruments.
See also: Download, Release Notes, Updates.
• • •
The new Xcode 16 AI autocomplete tech is actually really slick when it has contextual awareness.
First look at AI autocomplete in Xcode 16. It feels really nice to have Tab fill in actual code, and it stays mostly on task. However the speed isn’t great and it does hallucinate a lot. For example, in this run it tried to use a view that did not exist.
It also tries to use UIKit in a Mac app…
Xcode’s AI code completions are by far the worst AI based code completions I’ve come across.
It just totally hallucinates bullshit code with 100% confidence.
• • •
Swift Assist allows developers to type a natural language prompt to generate code and UIs. Code can even be created from the text of a developer’s inline comment. The model that powers Swift Assist has an awareness of the Human Interface Guidelines, Apple’s frameworks, and what Apple considers coding best practices.
I guess if you write Objective-C you don’t get good code completion
Kind of ridiculous that the first 2 default configurations of the latest M3 MacBook Pro (up to $1800!!!) can’t even do full Xcode 16.
Call me crazy, but I think every MacBook Pro should be able to handle all of the new Xcode things.
How does a “Pro” level laptop come with 8GB RAM by default?
• • •
“Fixed an issue where previously resolved Swift compiler diagnostics would reappear in the log and issue navigator in subsequent builds. (119533281)” [I want to believe.]
I……… don’t think Xcode 16 actually “fixed an issue where previously resolved Swift compiler diagnostics would reappear in the log and issue navigator in subsequent builds (119533281)”
I’m not finding this to be fixed, either. I’m also still seeing the same spurious errors related to conditional compilation in Swift.
If you see the error below when switching SwiftUI previews from a macOS target to an iOS target the following WILL NOT help:
- Cleaning the build
- Killing CoreSimulator processes
- Quitting and restarting Xcode
What WILL work is finding another tab with a hidden preview canvas for the wrong platform. And the subsequent swearing.
• • •
Xcode 16 introduces an experimental setting to explicitly build Swift modules. Here’s my notes from trying it out.
[…]
This explicit discovery and build process avoids the build system having to wait for unbuilt modules. Apple also claims this makes the debugger faster as it can share the already built modules with the debugger.
[…]
I’m not sure how representative my timings are but I’m not seeing any faster builds using explicitly built modules. If anything, it’s slower than the implicit builds in my tests.
If you’ve experienced long pauses when first inspecting variables in the debugger, you may find enabling explicit modules makes a big difference. When this is enabled, the debugger can make use of the same module files created during the build.
• • •
I still cannot get over it. Xcode getting EditorConfig support AND directory-based compilation. I could cry.
Everyone using local packages take note. Static libs are far more powerful, and their biggest downside is now gone.
I certainly love this new feature in Xcode 16 🥰
on sequoia you can only run xcode 16 beta.
that means i can’t really install sequoia on my primary dev machine — releasing software on a beta OS with beta Xcode seems… well… bad.
Did you know that you can open a file from another project side by side in your current project in Xcode? The file is not copied to your current project. It is just shown in the editor.
This is especially useful with the demo code from WWDC.
It’s disappointing that side-by-side diffs have not made it back to Xcode’s source control views.
It bums me out that the user experience of GitHub on the web is more flexible than the native IDE, especially since the side-by-side diffs used to be there in Xcode.
Seems no big changes to Xcode Cloud this year. Was hoping to get webhooks that tell us when a build has processed.
Best new feature I’ve seen in Xcode 16 Beta: simple breakpoints set in the lldb console are reflected in the UI. No need to reset them on every launch. Unfortunately, regex breakpoints are still not reflected nor settable via UI. Can I dare to dream?
In Xcode 16 beta 1 the keyboard shortcuts ctrl-n and ctrl-p no longer let you select a completion suggestion, and instead they move the cursor. It bugs me so much I actually filed a feedback. Please dupe if you use those too! I’d hate to have to start using the arrow keys for this.
Oh, in case you wonder why you never heard of
@retroactive
that is supported in Xcode 16b1: It’s from an enhancement that is currently in review. It’s not mentioned in the Swift 6 migration guide. It is required if you want to use aCNContactViewController
.
This wasted 2 days of development time, but in
WKNavigationDelegate
, thewebView(_:decidePolicyFor:decisionHandler:)
method has a new type signature that will ONLY work in the latest SDK. The change was that thedecisionHandler
now has a@MainActor
attribute. This causes Swift to recognize that it “almost” meets an optional requirement and suggests that you change it. If you change it, it will cause builds to not include the optional method.
Previously:
- XCTest in Xcode 16
- Xcode 16 Announced
- SpamSieve 3.0.5
- Using Apple Accounts With macOS Virtual Machines
- Xcode 15.4
- 8 GB of Unified Memory
- Xcode 15 Announced
Update (2024-07-18): Apple:
Apple Intelligence features are not supported on Virtual Machines and Simulators.
Update (2024-07-30): andrzejr:
Later on after installing Sequoia-beta2 and Xcode16-beta2 the predictive code completion stopped working. The info message in the Xcode settings said then that “Predictive code completion is not supported in this region”. Now, after installing Sequoia beta-4 and Xcode-beta4 the same message says “Predictive code completion is not available when booted from an external disk”.
Previously:
Update (2024-08-08): Avery Vine:
While localization extraction does occur after the build completes (and thus after macro expansion), localizations are extracted by reading the contents of your actual source code, and not expanded macros. Unfortunately, that means that it won’t pick any localized content generated by macros, unless the localized string is part of what’s used to expand the macro.
Update (2024-08-13): Tony Arnold:
Has anybody successfully enabled Explicitly Built Modules with Xcode 16? It’s causing build failures relating to type inference in SwiftUI for me.
7 Comments RSS · Twitter · Mastodon
I'm grateful every day that the vast majority of my professional macOS dev work does not require me to use Xcode.
Just out of curiosity because I don't use XCode: does the wonnerful new AI also work in Europe or is the AI pettiness only restricted to Apple Intelligence?
The memory restriction is ridiculous.
@Beatrix Willius
Out of curiosity, why are you spelling it XCode instead of Xcode? I've seen people doing it for years and I never understood the reason. Is it just easier to type with capital C? Or does it look better?
> Apple Intelligence features are not supported on Virtual Machines and Simulators.
Probably not the first thing users of VM on Apple Silicon Mac are complaining about. The state of VMs on Apple Silicon still seems to be really bad compared to what is possible on Intel-based Mac.
>Probably not the first thing users of VM on Apple Silicon Mac are complaining about.
Frankly the biggest, and IMHO most perplexing issue is that you effectively cannot run an Xcode debugger in a VM, because you cannot (easily) sign your app, because the Apple Account isn't available in the VM. This is finally, partially resolved in Sequoia, but it's been four years, and even in Sequoia, you'll only be able to do it in >= Sequoia. You still won't be able, on an ARM Mac, to do "hey, someone is reporting a bug specific to Ventura; can I debug that in a VM?" Answer: no, you can't. You'd have to install Ventura on a separate volume. (To be fair, APFS does makes that less painful.)