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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Icon dark mode not working on iPadOS
I updated the icons in Xcode to customize the appearance of my app icons to be light, dark, or tinted. The app is allowed to be downloaded and run on iPadOS. The app icon behaves as expected on iOS however the app icon does not change on the iPad. Am I missing a step for the iPad? To be clear the app does not target iPadOS rather it is just running the iOS version. Thanks kof
0
0
51
Apr ’25
Why Must All Attributes in a Composite Type Be Optional?
I recently encountered an issue involving Core Data’s new Composite Attributes feature and thought I would share my experience, as well as seek clarification. I created a composite type where all attributes were mandatory, except for one. Subsequently, I added an attribute to an entity and set its type to that composite type. Upon running the app, the console output the following error: CoreData: error: CoreData: error: Row (pk = 85) for entity ‘(EntityName)’ is missing mandatory text data for property ‘(propertyName)’ The way I resolved this was by removing the composite type attribute from the entity, after which the error no longer appeared. I also observed that in another entity, where a different composite type is used, all the attributes were optional — and no error occurred. This raises the question: why must all attributes in a composite type be optional? Furthermore, why does Xcode not inform the developer of this requirement? I have reviewed both the documentation and the WWDC23 “What’s New in Core Data” session, but neither mentions that having non-optional attributes within a composite type will cause such errors and lead to unpredictable application behaviour. Additionally, this issue remains unresolved in another area I raised previously in this topic: Composite Attributes feature requires tvOS deployment target 17.0 or later Composite Attributes feature requires watchOS deployment target 10.0 or later However, I do not have a tvOS or watchOS target, nor do I intend to add one. Could someone from Apple, or anyone with more experience, please clarify why all attributes within a composite type must be optional? And could it be possible for Xcode to flag this at compile time, rather than failing at runtime? Thank you in advance.
0
0
101
Apr ’25
Tabbar UITest bug on tvOS
When running UITests on tvOS, tabBar viewIdentifiers (UIKit) are no longer appearing. When you run the test, accessibility identifiers for tabs are no longer locatable but all other identifiers appears except for the tabs in the tabBar. In the stack trace of the debugger, if I print application, I can see all existing viewIdentifiers except those that were set for the tabs (on tvOS only). If I force an action on the simulator after the app has launched and the view appeared ie move left or right, the identifiers appears (confirmed by stack trace) and the test will continue as expected. This was not an issue in the past (no code changes). I am not sure if this appeared after updating my mac to Sequoia. But for iOS, there is no issue. This bug only appears on tvOS and specifically the tabs. Issue persists on: Sequoia 15.4.1 Xcode 16.3
1
0
116
May ’25
iOS 18.4で NFC や FeliCa の読み取りがしずらい状況のようです。こちらは認知されていますでしょうか?どのバージョンで直る想定でしょうか?
■概要: 弊社で開発しているアプリ内には、モバイルSuicaを読み取る機能があるのですが、iOS18.4でSuicaの読み取りができない事象に遭遇しています。(ごくまれに読み取れるときがある) ■利用API CoreNFC ■聞きたいこと: こちらいつごろ修正されるか教えてください。 ■参考情報 他社様ですが類似だと思われる事象が発生しております。
0
0
135
Apr ’25
Updated Deeplink is not working
Hello, We are facing deeplink related issue for our production app. In our finding, we got to know that issue is related to apple CDN caching, We have did the changes at our server level but still it is navigating to previous URL. Earlier deeplink was "https://bobcard.bobfinancial.com/dl" now it is changed to "https://linkdeep.bobcard.co.in/mapp". Please check and update this new one in apple cdn cache. For the new link it is redirecting to App store instead of App. Below are the link through which we have tested deeplink scenario: "https://app-site-association.cdn-apple.com/a/v1/bobcard.bobfinancial.com" working fine. "https://app-site-association.cdn-apple.com/a/v1/linkdeep.bobcard.co.in" it is throwing not found error.
1
0
90
Apr ’25
SWIFTUI LAYERING ISSUE: BACKGROUND ALWAYS APPEARS IN FRONT OF CONTENT
SWIFTUI LAYERING ISSUE: BACKGROUND ALWAYS APPEARS IN FRONT OF CONTENT THE PROBLEM I'm facing a frustrating issue in my SwiftUI macOS app where a background RoundedRectangle is consistently displaying in front of my content instead of behind it. This isn't an intermittent issue - it never works correctly. The colored background is always rendering on top of the text and icons, making the content completely unreadable. Here's my current implementation: private func sceneRow(for scene: Scene, index: Int) -> some View { ZStack(alignment: .leading) { // Hidden text to force view updates when state changes Text("$$noteStateTracker)") .frame(width: 0, height: 0) .opacity(0) // 1. Background rectangle explicitly at the bottom layer RoundedRectangle(cornerRadius: 6) .fill(sceneBackgroundColor(for: scene)) .padding(.horizontal, 4) // 2. Content explicitly on top HStack { Image(systemName: "line.3.horizontal") .foregroundColor(.blue) .frame(width: 20) Text("$$index). $$truncateTitle(scene.title.isEmpty ? "Untitled Scene" : scene.title))") .foregroundColor(selectedScene?.id == scene.id ? .blue : .primary) .fontWeight(selectedScene?.id == scene.id ? .bold : .regular) Spacer() if scene.isComplete { Image(systemName: "checkmark.circle.fill") .foregroundColor(.green) .font(.system(size: 12)) .padding(.trailing, 8) } } .padding(.vertical, 4) .padding(.leading, 30) } .contentShape(Rectangle()) .onTapGesture { selectedChapter = chapter selectedScene = scene } .onDrag { NSItemProvider(object: "$$scene.id.uuidString)|scene" as NSString) } .onDrop(of: ["public.text"], isTargeted: Binding( get: { hoveredSceneID == scene.id }, set: { isTargeted in hoveredSceneID = isTargeted ? scene.id : nil } )) { providers in handleSceneDrop(providers, scene, chapter) } .contextMenu { Button("Rename Scene") { sceneToRename = scene newSceneTitleForRename = scene.title newSceneDescriptionForRename = scene.description isRenamingScene = true } Button(role: .destructive) { confirmDeleteScene(scene, chapter) } label: { Label("Delete Scene", systemImage: "trash") } } } Despite explicitly ordering elements in the ZStack with the background first (which should place it at the bottom of the stack), the RoundedRectangle always renders on top of the text and icons. WHAT I'VE TRIED I've attempted multiple approaches but nothing works: ZStack with explicit zIndex values ZStack { RoundedRectangle(cornerRadius: 6) .fill(sceneBackgroundColor(for: scene)) .padding(.horizontal, 4) .zIndex(1) HStack { /* content */ } .padding(.vertical, 4) .padding(.leading, 30) .zIndex(2) } No effect - background still appears on top. Using .background() modifier instead of ZStack HStack { /* content */ } .padding(.vertical, 4) .padding(.leading, 30) .background( RoundedRectangle(cornerRadius: 6) .fill(sceneBackgroundColor(for: scene)) .padding(.horizontal, 4) ) Same issue - the background still renders in front of the content. Custom container view with GeometryReader struct SceneRowContainer: View { var background: Background var content: Content init(@ViewBuilder background: @escaping () -> Background, @ViewBuilder content: @escaping () -> Content) { self.background = background() self.content = content() } var body: some View { GeometryReader { geometry in // Background rendered first background .frame(width: geometry.size.width, height: geometry.size.height) .position(x: geometry.size.width/2, y: geometry.size.height/2) // Content rendered second content .frame(width: geometry.size.width, height: geometry.size.height) .position(x: geometry.size.width/2, y: geometry.size.height/2) } } } This changed the sizing of the components but didn't fix the layering issue. NSViewRepresentable approach I tried implementing a custom NSViewRepresentable that manually manages the view hierarchy: struct LayerOrderView: NSViewRepresentable { let background: () -> Background let content: () -> Content func makeNSView(context: Context) -> NSView { let containerView = NSView() // Add background hosting view first (should be behind) let backgroundView = NSHostingView(rootView: background()) containerView.addSubview(backgroundView) // Add content hosting view second (should be in front) let contentView = NSHostingView(rootView: content()) containerView.addSubview(contentView) // Setup constraints... return containerView } func updateNSView(_ nsView: NSView, context: Context) { // Update views... } } Even this direct AppKit approach didn't work correctly. Using .drawingGroup() ZStack { // Background RoundedRectangle(cornerRadius: 6) .fill(sceneBackgroundColor(for: scene)) .padding(.horizontal, 4) // Content HStack { /* content */ } .padding(.vertical, 4) .padding(.leading, 30) } .drawingGroup(opaque: false) Still no success - the background remains in front. PROJECT CONTEXT macOS app using SwiftUI Scene contents need to be displayed on top of colored backgrounds The view uses state tracking with a noteStateTracker UUID that updates when certain changes occur App needs to maintain gesture recognition for taps, drag and drop, and context menus The issue is completely reproducible 100% of the time - the background is always in front WHAT I WANT TO ACHIEVE I need a reliable solution to ensure that the background color (RoundedRectangle) renders behind the HStack content. The current behavior makes the text content completely unreadable since it's hidden behind the colored background. Has anyone found a workable solution for this seemingly basic layering problem in SwiftUI on macOS? Thank you for any help, Benjamin
3
0
132
Apr ’25
Xcode completion binding not working in 16.2
I'm wondering why 'Select Previous Completion' and 'Select Next Completion' aren't working. I'm using Ctrl-K and Ctrl-J but only my arrow keys work to navigation the completion list. 'Show Completion List' works just fine with Ctrl-Esc. There are no conflicts with any Xcode bindings, and I've checked my system settings for keyboard shortcuts as well.. I've completely disabled copilot, etc.. Is there another setting I'm missing? Or, is this a known issue?
0
0
38
Apr ’25
Xcode Build Failure
Hi, I don't understand why Xcode fails to build my app when following logic was uncommented as part of ternary operator (as highlighted in attachment). Can somebody help me please ?? Thx. ... : shelterViewModel.getShelter(row: row, column: column).productId == ... ? Color.yellow ...
6
0
298
Apr ’25
iOS Simulator Keychain Issues After Xcode Reinstall
Hello All I'm encountering an issue with Keychain access in iOS simulators after reinstalling Xcode. My app successfully accesses the Keychain on physical devices, but simulators consistently fail with errors. Details: App uses Keychain to store API keys Works perfectly on physical devices After Xcode reinstall, simulator Keychain access fails Error logs show "Keychain retrieve failed for key with status: -25300" I've properly configured Keychain Sharing entitlements My entitlements file includes: $(AppIdentifierPrefix)******* What I've tried: Resetting simulators Deleting simulator Keychain databases manually Adding Keychain Sharing capability Ensuring entitlements are correct My app worked fine with simulators before reinstalling Xcode, which suggests something changed in the development environment rather than my code. Has anyone encountered similar issues? Is there a recommended approach for handling Keychain access in simulators that's more resilient to Xcode environment changes? Thanks for your help!
0
0
153
Apr ’25
ActivityKit linker error
I have a ContentView in my app which includes the line of code FileUploadProgressAttributes. this struct is defined in a file included in the target FileUploadProgressExtension. and it is an ActivityAttributes. in ContentView I imported FileUploadProgressExtension, and the xcode is able to find the FileUploadProgressAttributes during prebuild. but during build, it gives me Undefined symbols for architecture arm64: "FileUploadProgressExtension.FileUploadProgressAttributes.init(filename: Swift.String) -> FileUploadProgressExtension.FileUploadProgressAttributes the workaround i found is to add the file with the FileUploadProgressAttributes to my app's target, but I'm not sure if this is the right thing to do. When Xcode created the extension for me, it added the extension target as a target dependency of my app. so obviously if i added this file to my app target it makes the extension target pointless. First time working with widgets so I'm not sure if I'm missing something.
0
0
86
May ’25
NSE Filtering Entitlement Rejected Repeatedly – Seeking Advice & Possible Solutions
Hi everyone, I’m facing a major roadblock with my family location tracking app, and I need some advice or guidance from the community. Background Back in 2021, I implemented NSE filtering entitlement to send location-based notifications and retrieve the device's location in return (as suggested by Apple’s technical code support). Over time, I built my app around this entitlement, adding many features that depend on it. When Location Push Service Extension was introduced for iOS 15+, I adapted accordingly: NSE filtering was used for devices below iOS 15 Location Push Service Extension was used for iOS 15+ NSE filtering also played a crucial role in: ✅ Accepting/rejecting location-based notifications ✅ Checking device settings & location permissions (since location push won’t work without proper permissions) The Issue In November 2024, I created a new developer account to change my business entity. Since then, I’ve been requesting the NSE entitlement repeatedly for four months, but Apple keeps rejecting it. Meanwhile, they approved the Location Push Entitlement, but without NSE filtering, I’m forced to rewrite a huge part of my app’s core functionality. I’ve sent multiple emails explaining my use case, but I keep getting rejected without any clear explanation or workaround. My Ask Has anyone faced a similar issue with NSE entitlement? Are there any alternative approaches to achieve the same functionality? Any advice on how to escalate this to Apple or get proper feedback on why it's being rejected? I’ve invested years into this app, and a forced rewrite would take months. Any help, insights, or contacts who could assist would be greatly appreciated! Thanks in advance! 🙏
0
0
65
Mar ’25
App Clip cannot determine the source of the opening
Our business is to scan the code to open App Clip, but then App Clip will appear in App Library and Siri Suggestions. This can be opened quickly, but the URL of the last scan will be included. This will cause a problem, for example: if the previous scan was code A, but the user does not scan code B when going to place B and directly opens it through App Library or Siri Suggestions, the code I get is still code A, so the result I want is that I want to know where it was opened from, and then if it is opened quickly, I will clear the URL and remind the user to scan the code again. Or if it is opened by quick opening, do not include the URL
0
0
33
May ’25
Is it possible to set the Derived Data location differently for different projects?
Within Xcode's settings location section is a drop down menu to switch between setting the derived data location to be default, relative or custom. However its a global setting. I work on more than one project simultaneously, and for one of them I want the location set to relative, but default for all the others. Is there any way of achieving that?
0
0
94
Apr ’25
Custom font not support in Xcode 16.3
I'm experiencing an issue with a custom font not loading properly in Xcode 16.3. The font files are included in the bundle, listed in Info.plist, and verified for correct names using UIFont.familyNames, but they still don't appear at runtime. Has anyone else run into this with Xcode 16.3? Could this be related to recent changes in asset packaging or font catalogs?
0
0
98
Apr ’25