Build, test, and submit your app using Xcode, Apple's integrated development environment.

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

A Summary of the WWDC25 Group Lab - Developer Tools
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for Developer Tools. Will my project codebase be used for training when I use Xcode's intelligent assistant powered by cloud-based models? When using ChatGPT without logging in, your data will not be used to improve any models. If you log in to a ChatGPT account, this is based on your ChatGPT account settings, which allows you to opt-out (it defaults to on). When using Xcode with accounts for other model providers, you should check with the policies of your provider. And finally, at no point will any portion of your codebase be used to train or improve any Apple models. We'd love to make our SwiftUI Previews (and soon, Playgrounds) as snappy as possible. Is there any way to skip certain build steps, such as running linters? It seems the build environment is exactly the same (compared to a debug build), but maybe there's a trick. Starting with Xcode 16, SwiftUI previews use the exact same build artifacts as the regular build. The new Playgrounds support in Xcode 26 uses these build artifacts too. Shell script build phases are the most common thing that introduces extra build time, so as a first step, try turning off all shell script build phases (like linters) to get an idea if that’s the issue. If those build phases add significant time to your build, consider moving some of those phases into asynchronous steps, such as running linters before committing instead of on every build. If you do need a shell script build phase to run during your build, make sure to explicitly define the input and output files, as that is a huge way to improve your build performance. Are we able to provide additional context for the models, like coding standards? Documentation for third party dependencies? Documentation on your own codebase that explains things like architecture and more? In general, Xcode will automatically search for the right context based on the question and the evolving answer, as the model can interact multiple times with your project as it develops an answer. This will automatically pick up the coding style of the code it sees, and can include files that contain architecture comments, etc. Beyond automatic context, you can manually attach other documents, even if they aren't in your project. For example, you could make a file with rules and ideas and attach it, and it will influence the response. We are very aware of other kinds of automatic context like rule files, etc, though Xcode does not support these at this time. Once ChatGPT is enabled for Coding Intelligence in Xcode 26, and I sign into my existing ChatGPT account, will the ChatGPT Coding Intelligence model in Xcode know about chat conversations on Xcode development done previously in the ChatGPT Mac app? Xcode does not use information from other conversations, and conversations started in Xcode are not accessible in the web UI or ChatGPT app. Is there a plan to make SwiftUI views easier to locate and understand in the view hierarchy like UIKit views? SwiftUI uses a declarative paradigm to define your user interface. That allows you to specify what you want, with the system translating that into an efficient representation at runtime. Unlike traditional AppKit and UIKit, seeing the runtime representation of SwiftUI views isn't sufficient in order to understand why it's not doing what you want. This year, we introduced a SwiftUI Instrument that shows why things are happening, like view re-rendering. Is it possible to use the AI chat with ChatGPT Enterprise? My company doesn't allow us to use the general ChatGPT, only the enterprise version they have setup that prevents data from being leaked Yes, Xcode 26 supports logging into any existing ChatGPT account, including enterprise accounts. If that does not meet your needs, you can also setup a local server that implements the popular chat completions REST API to talk to your enterprise account how you need. Now that Icon Composer is here, how does it complement or replace existing vector design tools such as Sketch for icon design? Icon Composer complements your existing vector design tools. You should continue to create your shapes, gradients, and layers in another tool like Sketch, and compose the exported SVG layers in Icon Composer. Once you bring your layers into Icon Composer, you can then use it to influence the translucency, blur, and specular highlights for your icon. What’s one feature or improvement in the new Xcode that you personally think developers will love, but might not immediately discover? Maybe something tucked away or quietly powerful that’s flown under the radar so far? One feature we're particularly excited about is the new power profiler for iOS, which gives you further insights into the energy consumption of your app beyond what was possible with the energy instrument previously. You can learn more about how to use this instrument and how it can help you greatly reduce your apps battery usage in the documentation, as well as the session Profile and optimize power usage in your app. There were also improvements in accessibility this year with Voice Control, where you can naturally speak your Swift code to Xcode, and it understands the Swift syntax as you speak. To see it in action, take a look at the demonstration in What’s new in Xcode 26. We have a software advisory council that is very sensitive to having our private information going to the cloud in any form. What information do you have to help me guide Xcode and Apple Intelligence through the acceptance process? One thing you can do is configure a proxy for your enterprise that implementing the popular Chat Completions API endpoint protocol. When using a model provider via URL, you can use your proxy endpoint to inspect the network traffic for anything that you do not want sent outside of your enterprise, and then forward the traffic through the proxy to your chosen model provider. Are there list of recommended LLMs to use with Xcode via Intelligence/Local? I've tried Gemma3-12B, but.. I hope there are better options? Apple doesn't have a published list of recommended local models. This is a fast-moving space, and so a recommendation would become out of date very quickly as new models are released. We encourage you to try out the local model support in Xcode 26 with models that you find meet your needs, and let us and the community know! (continued below)
1
0
643
Jul ’25
Chooser from Open Quickly missing in Xcode 26?
This whole time I was convinced that Apple just re-bound my favorite keyboard shortcut to something else in Xcode 26 and I just needed to find it and re-bind it, but it looks like they've gotten rid of it altogether and I'm losing my mind. For many years, selecting a type in the Open Quickly menu (Shift-Command-O) and hitting Shift-Option-Enter would bring up a chooser that would let you move a cursor around and select which open pane to open the file in (or create a new pane.) It was so useful and made working in Xcode so fast and it really seems like it's gone for good. Has this behaviour been changed? I don't see it mentioned in "What's New in Xcode 26?"
0
0
8
2h
Xcode 16.2 : Unable to install Platform Support Runtimes + Predictive Code Completion Model
Summary : I tried everything from uninstalling completely XCODE to upgrading the macOS without any success. Cleanup Xcode & Upgrade macOS to 15.3.1 This scripts were used to clean up the xcode and residual files. Also used CleanMyMac for the rest ! VERSION="" # "-16.2.0" ## Xcode Deep Clean # 1. Delete Xcode Itself sudo rm -rf /Applications/"Xcode${VERSION}".app # 2. Remove Xcode Cache and Derived Data sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode sudo rm -rf ~/Library/Developer/Xcode sudo rm -rf ~/Library/Application\ Support/Xcode sudo rm -rf ~/Library/Developer/CoreSimulator sudo rm -rf ~/Library/Developer/Shared # 3. Remove Command Line Tools (CLT) sudo rm -rf /Library/Developer/CommandLineTools # 4. Remove Xcode Preferences and Supporting Files sudo rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist sudo rm -rf ~/Library/Logs/CoreSimulator sudo rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState # 5. Remove Simulator Data sudo rm -rf ~/Library/Developer/CoreSimulator # 6. Remove Swift & Code Completion Models sudo rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode sudo rm -rf ~/Library/Application\ Support/Xcode Problem : When i try to press the button "Get" from Xcode -> Settings -> Components i receive systematically these issues : For Predictive Code Completion Model : The operation couldn’t be completed. (IDELanguageModelKit.IDEModelDownloadAdapter.(unknown context at $11b3c5a90).DownloadError error 2.) Domain: IDELanguageModelKit.IDEModelDownloadAdapter.(unknown context at $11b3c5a90).DownloadError Code: 2 User Info: { DVTErrorCreationDateKey = "2025-02-20 2:36:06\U202fPM +0000"; } -- There was an error transferring over the network. Domain: IDELanguageModelKit.IDEModelDownloadAdapter.(unknown context at $11b3c5a90).DownloadError Code: 2 -- System Information macOS Version 15.3.1 (Build 24D70) Xcode 16.2 (23507) (Build 16C5032a) Timestamp: 2025-02-20T15:36:06+01:00 For Platform Support (ex. iOS 18.2 + iOS 18.3.1 Simulator) Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2025-02-20 2:24:03\U202fPM +0000"; } -- Download failed. Domain: DVTDownloadableErrorDomain Code: 41 -- Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22D8075; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 -- Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 User Info: { checkConfiguration = 1; } -- System Information macOS Version 15.3.1 (Build 24D70) Xcode 16.2 (23507) (Build 16C5032a) Timestamp: 2025-02-20T15:24:03+01:00 More Details : By the way im on a MacBook Pro with M1 Max 32GB and 1TB storage. I still have more than 100 GB of Storage. I also switched to RJ45 to be sure its not network issue !
10
2
864
3h
Communication with Apple failed
‘Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/ Xcode couldn't find any tvOS App Development provisioning profiles matching ’ I followed the instructions and created it manually, but it still doesn't work. Why is that? I remember it used to be created automatically and take effect right away.
3
0
84
3h
Xcode 26.1 RC issue
I'm seeing a lot of unexpected CPU usage when running the iOS 26.1 simulator. Looks like a "MercuryPosterExtension" is crashing over and over, which then causes the "ReportCrash" process to run, presumably to create the crash report. Doesn't happen on device, nor on iOS 26.0 simulator. I suspect MercuryPoster is related to wallpaper. I also don't see any wallpaper background in my simulator. Few lines from the stack trace: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libxpc.dylib 0x18011defc _xpc_api_misuse + 88 1 libxpc.dylib 0x18012e16c _xpc_shmem_create_with_prot.cold.1 + 24 2 libxpc.dylib 0x180113a70 _xpc_shmem_create_with_prot + 276 3 MTLSimDriver 0x23795ed48 -[MTLSimDevice newBufferWithLength:options:pointer:copyBytes:deallocator:] + 260 4 MercuryPosterExtension 0x10081d21c 0x100758000 + 807452 13 PosterKit 0x240d003d8 -[PRRenderer scene:willConnectToSession:options:] + 648 14 UIKitCore 0x1856bcf18 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 956
3
2
79
3h
XCode problem
Right now, I am trying the tutorial for SwiftUI from the Apple Developer Program inside of Xcode, but I encountered a problem. Inside of the selectable canvas mode in Xcode, I wanted to command-control-click the element (in this case, a text) to bring up the editing popover and select "Show SwiftUI Inspector." For some reason, on the popover menu, the only option was "Embed." I only wanted the menu point Show SwiftUI Inspector, and I also tried the shortcut Ctrl+Option, but nothing worked. Now is there another method to get to this menu? Or can you help me with that? Noah
0
0
9
4h
CompileAssetCatalogVariant failed with nonzero exit code.
I'm running in a very very very weird error. I have a large asset catalog, consisting of about 2700 assets for 1.19GB of size. I can successfully build and run my project with both release and debug scheme, when a real device or simulator is selected. However, whenever I select Any iOS device (arm64), about 80ish seconds in the build process, the building fails with the following output: CoreUI: Error: unable to add asset to store *** Terminating app due to uncaught exception 'IBPlatformToolFailureException', reason: 'The tool closed the connection (AssetCatalogSimulatorAgent) What I tried and failed: Cleaning DerivedData and restarting PC Building the same project on three different devices, each with a different version of XCode. All failed. running sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService Scanning for duplicate image files, found none. Scanning for duplicate .imageset folders in different folders, found none. Scanning for images that declared a different format than theirs, eg .webp renamed as .png, and found none. Creating an empty Hello World project, and just adding my asset catalog. Build fails for Any iOS device, succeeds for simulator or physical device. Uninstalling and reinstalling XCode command line tools. Manually compiling via actools. Changed "Embed Assets Pack in Product Bundle" from No to Yes. I don't have any .svg file in my assets. What I tried and failed but gives more insight: Now the only thing that I was able to come up with was deleting folders to narrow down where the problem was. So I found that there is a 700MB folder called T, containing T1, T2, ..., T6. Eventually managed to narrow down even more to T3, T4, T6. I created a distinct .xcassets catalog for each subfolder and tried to compile individually with actools, along with assets.xcassets (the main one). Here's the thing: T3.xcassets + assets.xcassets compiles T4.xcassets + assets.xcassets compiles T6.xcassets + assets.xcassets compiles T3.xcassets + T4.xcassets + assets.xcassets compiles. T3.xcassets + T6.xcassets + assets.xcassets compiles. T4.xcassets + T6.xcassets + assets.xcassets compiles. T3.xcassets + T4.xcassets + T6.xcassets + assets.xcassets crashes with CoreUI: Error: unable to add asset to store. I've been stuck for days now and can't deploy my finished app I worked on for the last three years because of this.
4
0
89
4h
Apple Watch may need to be unlocked to recover from previously reported preparation errors
I'm trying to run(debug) an Xcode watch app project on my watch. My phone is connected to my computer via USB cable, my watch is paired to my phone. When I open Xcode and then open "Devices and simulators", I can see my phone properly connected. But these errors show up for my watch........ Apple Watch may need to be unlocked to recover from previously reported preparation errors Ensure the device is unlocked and associated with the same local area network as this Mac. A connection to this device could not be established. Timed out while attempting to establish tunnel using negotiated network parameters. I have booted computer, phone and watch. I have turned wifi off and on, on all 3 devices. I have turned developer mode on the watch off and then back on again. Anyone have any ideas how to fix this?
4
1
192
5h
Invalid parameter not satisfying: parentEnvironment != nil
Since the beta releases of iPadOS 26 we have been having some crashes about Invalid parameter not satisfying: parentEnvironment != nil We got to contact a couple of users and we found out that the crash appears when entering a screen in a UINavigationController with the iPad device connected to a Magic Keyboard. If the device is not connected to the keyboard then nothing happens and everything works ok. From our end we haven't managed to reproduce the crash so I am pasting part of the stacktrace if it can be of any help. 3 UIKitCore 0x19dfd2e14 -[_UIFocusContainerGuideFallbackItemsContainer initWithParentEnvironment:childItems:] + 224 (_UIFocusContainerGuideFallbackItemsContainer.m:23) 4 UIKitCore 0x19dae3108 -[_UIFocusContainerGuideImpl _searchForFocusRegionsInContext:] + 368 (_UIFocusGuideImpl.m:246) 5 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 6 UIKitCore 0x19db28900 -[_UIFocusMapSnapshot addRegionsInContainers:] + 160 (_UIFocusMapSnapshot.m:545) 7 UIKitCore 0x19d1313dc _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 632 (_UIFocusRegion.m:143) 8 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 9 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 10 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 11 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 12 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 13 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 14 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 15 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 16 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 17 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 18 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 19 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 20 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 21 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 22 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 23 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 24 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 25 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 26 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 27 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 28 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 29 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 30 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 31 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 32 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 33 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 34 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 35 UIKitCore 0x19d1320fc _UIFocusItemContainerAddChildItemsInContextWithOptions + 596 (UIFocusItemContainer.m:183) 36 UIKitCore 0x19d131b98 _UIFocusRegionSearchContextAddChildItemsInEnvironmentContainer + 648 (_UIFocusRegion.m:108) 37 UIKitCore 0x19d131398 _UIFocusRegionSearchContextSearchForFocusRegionsInEnvironment + 564 (_UIFocusRegion.m:140) 38 UIKitCore 0x19db1d244 -[_UIFocusRegionContainerProxy _searchForFocusRegionsInContext:] + 140 (_UIFocusRegionContainerProxy.m:184) 39 UIKitCore 0x19db28498 -[_UIFocusMapSnapshot addRegionsInContainer:] + 2720 (_UIFocusMapSnapshot.m:531) 40 UIKitCore 0x19d132e08 -[_UIFocusMapSnapshot _capture] + 424 (_UIFocusMapSnapshot.m:403) 41 UIKitCore 0x19db2675c -[_UIFocusMapSnapshot _initWithSnapshotter:mapArea:searchArea:] + 476 (_UIFocusMapSnapshot.m:171) 42 UIKitCore 0x19d130dcc -[_UIFocusMapSnapshotter captureSnapshot] + 192 (_UIFocusMapSnapshotter.m:137) 43 UIKitCore 0x19db2045c -[_UIFocusMap _inferredDefaultFocusItemInEnvironment:] + 136 (_UIFocusMap.m:168) 44 UIKitCore 0x19daffd2c -[_UIFocusEnvironmentPreferenceEnumerationContext _inferPreferencesForEnvironment:] + 140 (_UIFocusEnvironmentPreferenceEnumerator.m:313) 45 UIKitCore 0x19d127ab4 -[_UIFocusEnvironmentPreferenceEnumerationContext _resolvePreferredFocusEnvironments] + 104 (_UIFocusEnvironmentPreferenceEnumerator.m:250) 46 UIKitCore 0x19d127394 -[_UIFocusEnvironmentPreferenceEnumerationContext preferredEnvironments] + 36 (_UIFocusEnvironmentPreferenceEnumerator.m:184) 47 UIKitCore 0x19d126e94 _enumeratePreferredFocusEnvironments + 400 (_UIFocusEnvironmentPreferenceEnumerator.m:503)
0
0
24
6h
Just tried Copilot for Xcode—loving the new MCP Registry, Agent mode and more features!
I'm a regular Xcode user and recently started using GitHub Copilot for Xcode—it's been a real game-changer for my workflow. The latest update introduces MCP Registry and Allowlist Controls in public preview. My favorite parts: Browse and install MCP servers directly inside Xcode—no manual setup required. For teams, admins can enforce policies for added security. Just saw this announcement at GitHub Universe! If you haven't tried it yet, grab the pre-release build: 👉 https://aka.ms/copilot-xd-mcpreg-allowlist-preview
0
0
11
6h
Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
I just install xcode 26.0.1 throungh app store, but when i 'xcodebuild -downloadComponent MetalToolchain', i get wrong Metal Toolchain 17A324, which is the wrong version. The correct version is 17A5241e i think. This issue i saw 26.1 release has fixed, https://developer.apple.com/documentation/xcode-release-notes/xcode-26_1-release-notes. How can i get update?
4
0
127
16h
Xcode26.1 compile error: cannot execute tool 'metal' due to missing Metal Toolchain
When I use Xcode26.1 or Xcode26.0.1 compile my project, Xcode failed with error error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain. I search around and found this is a known issue and fixed in Xcode26, but I get this error in latter versions. I tried all the methods in documents(https://developer.apple.com/documentation/xcode-release-notes/xcode-26-release-notes) to intall Metal component, but it still compile error with the same error. I also delete Xcode and all related components restart computer and reinstall Xcode26.1, it's not work also. macOS version: 26.0.1 (25A362) Xcode version: 26.1 MetalToolchain version: 17.0 (17B54)]
1
0
44
16h
Xcode_26 not compiling Metal project
Hello Xcode 26.0.1 (17A400) Missing some Metal components When building a program using Metal, it induces an unexpected error : “error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain Command CompileMetalFile failed with a nonzero exit code” Which terminates the build The fix given “xcodebuild -downloadComponent MetalToolchain” using sudo does not work Did someone find a work around or could resolve the issue? Many thanks Jean MacBook Air M4; macOS 26.0.1; Xcode 26.0.1
3
2
210
16h
ToolbarItem with .hidden() or .opacity(0) leaves a visible frame when built with Xcode 26 (worked fine in Xcode 16.4)
In Xcode 16.4, I could hide a ToolbarItem simply by applying .hidden() or .opacity(0), and the button disappeared completely — including its touch area and layout space. However, when I build the same code with Xcode 26, the button visually disappears but its frame and tap area remain, as if the ToolbarItem were still present but invisible. This causes an empty tappable area to remain in the toolbar. Here’s a simplified example: .toolbar { ToolbarItem(placement: .topBarLeading) { Button("Back") { // action } .opacity(isSelectionMode ? 0 : 1) // or .hidden() – both produce the same issue } ToolbarItem(placement: .principal) { Text("Title") } ToolbarItem(placement: .topBarTrailing) { Button("Select") { isSelectionMode.toggle() } } } Expected behavior (Xcode 16.4):  When isSelectionMode becomes true, the Back button disappears completely and its space in the toolbar is released. Actual behavior (Xcode 26):  The Back button becomes invisible, but its tappable area and layout spacing remain, leaving an empty spot in the toolbar. To work around this, I tried conditionally including the ToolbarItem only when isSelectionMode == false, like this: @ToolbarContentBuilder private var toolbarLeadingContent: some ToolbarContent { if !isSelectionMode { ToolbarItem(placement: .topBarLeading) { Button("Back") { } } } } However, this approach fails to build when the minimum deployment target is iOS 15, showing the compiler error: 'buildIf' is only available in iOS 16.0 or newer I understand that @ToolbarContentBuilder relies on buildIf internally for conditional branches, which explains the limitation, but this means there’s currently no iOS 15–compatible way to completely remove a ToolbarItem at runtime. So my questions are: Is the layout change in Xcode 26 an intentional behavior change in SwiftUI? What’s the correct way to fully remove a ToolbarItem on iOS 15–compatible projects without using buildIf?
0
0
30
18h
Adding App Icon to Xcode for Tahoe
I have designed a new icon for my app/Tahoe in Icon Composer (launched from within Xcode)but I simply cannot get it to show up. The documentation for Icon Composer spends a lot of time describing how to design the icons but goes distressingly vague/silent on how one might use it. It suggests that I should drag the file to Xcode and it will guide me as to where to put it. The app continues to use the old (pre-Tahoe) icon. I don't get any change of behaviour and I don't know what to name the file. I assume that there are no other settings that I have to change. I can't find anything on the web or in Apple's documentation: maybe I'm missing something obvious! My app is a working NSDocument-based Cocoa project. Any suggestions please. Tahoe 26.0.1, Xcode 26.0.1, Apple M1 Max MBP.
6
0
215
21h
Xcode 26.0 Share Extension crashes with NSInternalInconsistencyException on iOS 26.0
Issue : When creating a new project in Xcode 26.0 and adding a Share Extension target without modifying any code, the app crashes upon displaying the extension screen with the following error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The layout constraints still need update after sending -updateConstraints to <_UINavigationBarTitleControl: 0x105b9cc00; frame = (0 0; 0 0); layer = <CALayer: 0x10b834270>>. _UINavigationBarTitleControl or one of its superclasses may have overridden -updateConstraints without calling super. Or, something may have dirtied layout constraints in the middle of updating them. Both are programming errors.' Environment : Xcode 26.0 iOS 26.0 (physical device) Note: This issue does not occur when running on iOS 18.3.1 (physical device). Temporary Workaround : Adding the following implementation to the isContentValid method prevents the exception from occurring: Objective-C- (BOOL)isContentValid { // Do validation of contentText and/or NSExtensionContext attachments here if (@available(iOS 26, *)) { self.navigationController.navigationBarHidden = YES; } return YES; } Questions : Is there any alternative way to avoid this exception? Since this crash occurs with the default implementation generated by Xcode, is there any plan to fix it in future updates?
2
0
79
1d
Regarding the Deployment Targets setting for Xcode 26
Our project plans to upgrade Xcode from 16.2 to Xcode 26. We’ve noticed that the information on https://developer.apple.com/support/xcode/ states that the Deployment Targets for Xcode 26 supports iOS 15–26.1. However, the Deployment Targets for our current project is set to iOS 13. Does this mean that we must set the project’s Deployment Targets to iOS 15 or higher if we want to upgrade to Xcode 26? Can we still set the Deployment Targets to iOS 13? If we upgrade to Xcode 26 and set the Deployment Targets to iOS 13, will there be any problems?
2
0
94
1d