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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Deep link to a file in Xcode
Hi, is there documentation on how to write a deep link that will open Xcode on a given file, and optionally a line number? I know about xed, and I would like exactly that functionality, but in link form, so that I can link to a certain file from an app such as Obsidian or from a README.md file. I checked Xcode's Info.plist and it understands several URL schemes, the most promising of which is xcode://, which successfully launches the app, but no matter what I tried, I get an error dialog telling me that Xcode did not understand the URL. Any help on this topic would be greatly appreciated. Victor
0
0
300
Mar ’25
Cannot Find UI to Add Core Data Database Indexes in Xcode 16.2
Hi everyone, I'm trying to add standard, non-unique database indexes to my Core Data entities for performance optimization (e.g., indexing Date or String attributes used in predicates and sort descriptors). I'm using Xcode 16.2 on macOS Sequoia 15.1. My problem is that I cannot find the expected UI element in the Core Data model editor (.xcdatamodeld) to configure these database indexes. What I Understand / Expect: I know the old "Indexed" checkbox on the Attribute Inspector is deprecated/gone. My understanding from recent documentation and tutorials is that database indexing (separate from Spotlight indexing) should be configured in the Entity Inspector (when the Entity itself is selected), within a section titled "Indexes" (usually located below "Constraints"). This "Indexes" section should allow adding individual or compound indexes that translate to SQL CREATE INDEX commands, distinct from uniqueness constraints. What I'm Experiencing: When I select an Entity in the model editor, the "Indexes" section is completely missing from the Data Model Inspector pane on the right. I see sections for Name, Class, Constraints, Spotlight, User Info, Versioning, etc., but no "Indexes" section appears between Constraints and Spotlight (or anywhere else). Troubleshooting Steps Taken: Verified Selection: I have confirmed I am selecting the Entity itself in the left-hand list, not an individual Attribute. Ruled out Spotlight Indexing: I understand the difference between database indexing (for internal query performance) and the "Index in Spotlight" checkbox/Core Spotlight framework (for system search). I specifically need the former. Basic Xcode Troubleshooting: I have tried restarting Xcode, cleaning the build folder (Shift+Command+K), and deleting the project's Derived Data. The "Indexes" section remains missing. Checked File Placement/Target Membership: Confirmed the .xcdatamodeld file is correctly included in the target. Its location in the project navigator doesn't seem relevant. Checked Model Versioning: Ensured the correct model version is set as "Current" in the File Inspector. Ruled out Other Features: Confirmed that Fetch Requests, Fetched Properties, and User Info keys are not the mechanisms for defining database indexes. Confirmed Not Project-Specific: I created a brand new, template-generated iOS App project with "Use Core Data" checked. In this new project, when selecting the default "Item" entity, the "Indexes" section is also missing from the Entity Inspector. This strongly suggests the issue is with my Xcode environment/version itself, not my specific project's setup. Considered Programmatic/Manual: I understand Core Data expects schema definitions (including indexes) declaratively in the model file. While manual XML editing of the contents file works (adding ... within the tag), this is not the desired or intended workflow via the standard tools. My Questions: What is the correct, current procedure for defining non-unique Core Data database indexes using the Xcode UI in Xcode 16.2? Has the location or method for configuring database indexes changed in this version of Xcode? If so, where is it now? Is the absence of the "Indexes" section in the Entity Inspector a known issue or intentional change for this Xcode version? If the standard UI method is unavailable, what is the officially recommended approach (other than manual XML editing)? I've reviewed the documentation ("Configuring Entities", "Configuring Attributes") and while screenshots show the inspectors, they don't definitively show the "Indexes" section within the Entity Inspector, sometimes focusing on attributes or potentially being cropped. Any clarification or guidance would be greatly appreciated!
0
0
79
Apr ’25
Xcode crash reports from TestFlight
My application is in flightTest mode. I received my first two crash reports in XCODE /Organizer. The context is well described, and I was able to isolate the locations where very serious errors occurred. My application is connected. I'm missing one piece of data in this crash report: the time of the crash. This will help me see what (in my case) static data was being read on the data server at that time. This will help me investigate. Is it possible to obtain this information?
0
0
91
Mar ’25
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
47
Apr ’25
Swift, kevent, and wth?!?!?
I have this code: var eventIn = kevent(ident: UInt(self.socket), filter: Int16(EVFILT_WRITE), flags: UInt16((EV_ADD | EV_ENABLE)), fflags: 0, data: 0, udata: nil ) I looked at it and thought why do I have those extra parentheses? So I changed it to var eventIn = kevent(ident: UInt(self.socket), filter: Int16(EVFILT_WRITE), flags: UInt16(EV_ADD | EV_ENABLE), // changed line! fflags: 0, data: 0, udata: nil ) and then kevent gave me EBADF. Does this make sense to anyone?
0
0
242
Feb ’25
App crashing on real iPhone only (working fine on simulator and Xcode preview)
Hi, I'm currently facing an issue where my React Native app crashes only on a real iPhone. On the simulator and in Xcode preview, the app runs fine. Previously, I had an issue with FlatList regarding props.getItem, which I solved by installing some missing Babel dependencies. After that, everything worked correctly in the simulator. But when I try to open the app on a real device, it shows the splash screen and crashes immediately. I've already done a full clean and reset, including: npx react-native start --reset-cache Deleted node_modules and Pods, reinstalled everything Cleaned build folder via Xcode Deleted DerivedData Restarted Metro bundler and simulator/device The issue only happens on the physical device. Here’s a portion of the crash log IDate/Time: 2025-04-14 19:11:28.6796 -0300 Launch Time: 2025-04-14 19:11:28.5292 -0300 OS Version: iPhone OS 18.3.2 (22D82) Release Type: User Baseband Version: 4.20.03 Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: JazminChebar [1973] Triggered by Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x19a0865fc __exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x197601244 objc_exception_throw + 88 (objc-exception.mm:356) 2 JazminChebar 0x1009b2c04 RCTFatal + 568 (RCTAssert.m:147) 3 JazminChebar 0x1009c81f8 __28-[RCTCxxBridge handleError:]_block_invoke + 532 (RCTCxxBridge.mm:1178) 4 libdispatch.dylib 0x1a1e19248 _dispatch_call_block_and_release + 32 (init.c:1549) 5 libdispatch.dylib 0x1a1e1afa8 _dispatch_client_callout + 20 (object.m:576) 6 libdispatch.dylib 0x1a1e29a34 _dispatch_main_queue_drain + 984 (queue.c:8093) 7 libdispatch.dylib 0x1a1e2964c _dispatch_main_queue_callback_4CF + 44 (queue.c:8253) 8 CoreFoundation 0x19a0d2bcc CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1793) 9 CoreFoundation 0x19a0cf1c0 __CFRunLoopRun + 1996 (CFRunLoop.c:3163) 10 CoreFoundation 0x19a121284 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434) 11 GraphicsServices 0x1e73914c0 GSEventRunModal + 164 (GSEvent.c:2196) 12 UIKitCore 0x19cc6a674 -[UIApplication _run] + 816 (UIApplication.m:3846) 13 UIKitCore 0x19c890e88 UIApplicationMain + 340 (UIApplication.m:5503) 14 JazminChebar 0x100178708 main + 80 (main.m:7) 15 dyld 0x1c037dde8 start + 2724 (dyldMain.cpp:1338)
0
0
74
Apr ’25
Xcode 16 Build & Archive Error - SPM
Since upgrading from Xcode 15 to 16, we have been experiencing a build error during compilation. Building on Xcode 15 still works with no issues. The error happens only on the first build after a clean. Subsequent builds succeed. This is an issue because our CI process archives the project from a clean slate, and this causes it to fail every time. I will attempt to describe the issue and include information I believe is relevant in this document. The error occurs on this import line within an Objective-C file during the Scan Dependencies step of compiling. This line imports our custom Objective-C to Swift bridging header file - "Swift2Objc.h". Our custom Objective-C to Swift bridging header file is simply wrapping the project’s auto-generated Objective-C to Swift bridging header file - "KWISwift.h". The error is specific to the import of the OfflineServices Swift Package. Specifically, the OfflineServices-Swift.h file - the Swift Package’s auto-generated Objective-C to Swift bridging file. Module JRE not found - the exact error (Also included as text on the bottom of the post) JRE is a third-party library provided to us as an xcframework. It is placed directly into our Swift Package as a binary target. The xcframework itself is composed of .a file and a Headers folder which includes header files and a module.modulemap. The module.modulemap file looks like this.
0
0
212
Mar ’25
Xcode 16.2: build fails with errors from another project
When I thought Xcode could not get any worse, here's the most absurd thing I have ever seen developing software in almost 20 years of work. When building a project, which I haven't touched lately, and last time it was building just fine, it raised errors on a class that doesn't even belong in any way to such project, it only exists in another one. To clarify, we're talking of a project written in C++ which runs only on mac, which is failing due to linker errors, where the linker can not find symbols of a class living in a different project and that is not referenced in any way inside this project. I mean, really? how does Apple manage to make Xcode more and more unstable by the minute? Starting from Xcode 15.1 I was already experiencing much longer building times, due to the fact that it doesn't manage the cache properly and is rebuilding lots of stuff every time..
0
0
41
Apr ’25
How to make RealityKit both parent and child entities accessible to UI tests?
I have a SwiftUI RealityKit app, and I am writing UI tests for it. The app has entities that have children. All entities have an accessibilityComponent so that they can be found by UI tests. If I set isAccessibilityElement = true for the parent, the UI tests find the parent. If I set isAccessibilityElement = false for the parent, and isAccessibilityElement = true for the child, the UI tests find the child. If I set isAccessibilityElement = true for the parent as well as for the child, the UI tests find only the parent. How can I make parent and child entities both be accessible by the UI tests?
0
0
285
Feb ’25
Xcode 16.2 archive fails to compile XIB
Xcode 16.2 archive fails to compile XIB Xcode Archive command fails most of the time while compiling an XIB which was created in older Xcode. XIB was updated in Xcode 16.2 version also which did not fix this issue. Archive from Xcode app works but Xcode build command fails and no reason shown by the command. ** ARCHIVE FAILED ** The following build commands failed: CompileXIB /Users…/Resources/Nibs/<XIB_NAME>.xib
0
0
111
Apr ’25
How to Export OBJ with Texture (JPG + MTL) from ARKit LiDAR Scan in iOS?
I am using ARKit with RealityKit to scan objects using LiDAR on iOS. I can generate an OBJ file from ARMeshAnchors, but I am missing the texture export (JPG + MTL). What I Have So Far: Successfully capturing mesh using ARMeshAnchor. Converting mesh into MDLAsset and exporting .obj. I need help generating the .jpg texture and linking it to the .mtl file. private func exportScannedObject() { guard let camera = arView.session.currentFrame?.camera else { return } func convertToAsset(meshAnchors: [ARMeshAnchor]) -> MDLAsset? { guard let device = MTLCreateSystemDefaultDevice() else {return nil} let asset = MDLAsset() for anchor in meshAnchors { let mdlMesh = anchor.geometry.toMDLMesh(device: device, camera: camera, modelMatrix: anchor.transform) // Apply a gray material to the mesh let material = MDLMaterial(name: "GrayMaterial", scatteringFunction: MDLScatteringFunction()) material.setProperty(MDLMaterialProperty(name: "baseColor", semantic: .baseColor, float3: SIMD3(0.5, 0.5, 0.5))) // Gray color if let submeshes = mdlMesh.submeshes as? [MDLSubmesh] { for submesh in submeshes { submesh.material = material } } asset.add(mdlMesh) } return asset } func export(asset: MDLAsset) throws -> URL { let directory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! let url = directory.appendingPathComponent("scaned.obj") if MDLAsset.canExportFileExtension("obj") { do { try asset.export(to: url) return url } catch let error { fatalError(error.localizedDescription) } } else { fatalError("Can't export USD") } } if let meshAnchors = arView.session.currentFrame?.anchors.compactMap({ $0 as? ARMeshAnchor }), let asset = convertToAsset(meshAnchors: meshAnchors) { do { let url = try export(asset: asset) showScanPreview(url) } catch { print("export error") } } } extension ARMeshGeometry { func vertex(at index: UInt32) -> SIMD3<Float> { assert(vertices.format == MTLVertexFormat.float3, "Expected three floats (twelve bytes) per vertex.") let vertexPointer = vertices.buffer.contents().advanced(by: vertices.offset + (vertices.stride * Int(index))) let vertex = vertexPointer.assumingMemoryBound(to: SIMD3<Float>.self).pointee return vertex } // helps from StackOverflow: // https://stackoverflow.com/questions/61063571/arkit-3-5-how-to-export-obj-from-new-ipad-pro-with-lidar func toMDLMesh(device: MTLDevice, camera: ARCamera, modelMatrix: simd_float4x4) -> MDLMesh { func convertVertexLocalToWorld() { let verticesPointer = vertices.buffer.contents() for vertexIndex in 0..<vertices.count { let vertex = self.vertex(at: UInt32(vertexIndex)) var vertexLocalTransform = matrix_identity_float4x4 vertexLocalTransform.columns.3 = SIMD4<Float>(x: vertex.x, y: vertex.y, z: vertex.z, w: 1) let vertexWorldPosition = (modelMatrix * vertexLocalTransform).columns.3 let vertexOffset = vertices.offset + vertices.stride * vertexIndex let componentStride = vertices.stride / 3 verticesPointer.storeBytes(of: vertexWorldPosition.x, toByteOffset: vertexOffset, as: Float.self) verticesPointer.storeBytes(of: vertexWorldPosition.y, toByteOffset: vertexOffset + componentStride, as: Float.self) verticesPointer.storeBytes(of: vertexWorldPosition.z, toByteOffset: vertexOffset + (2 * componentStride), as: Float.self) } } convertVertexLocalToWorld() let allocator = MTKMeshBufferAllocator(device: device); let data = Data.init(bytes: vertices.buffer.contents(), count: vertices.stride * vertices.count); let vertexBuffer = allocator.newBuffer(with: data, type: .vertex); let indexData = Data.init(bytes: faces.buffer.contents(), count: faces.bytesPerIndex * faces.count * faces.indexCountPerPrimitive); let indexBuffer = allocator.newBuffer(with: indexData, type: .index); let submesh = MDLSubmesh(indexBuffer: indexBuffer, indexCount: faces.count * faces.indexCountPerPrimitive, indexType: .uInt32, geometryType: .triangles, material: nil); let vertexDescriptor = MDLVertexDescriptor(); vertexDescriptor.attributes[0] = MDLVertexAttribute(name: MDLVertexAttributePosition, format: .float3, offset: 0, bufferIndex: 0); vertexDescriptor.layouts[0] = MDLVertexBufferLayout(stride: vertices.stride); let mesh = MDLMesh(vertexBuffer: vertexBuffer, vertexCount: vertices.count, descriptor: vertexDescriptor, submeshes: [submesh]) return mesh } } What I Need Help With: How do I generate the JPG texture from the AR scene? How do I save an MTL file linking the OBJ model to the texture? How can I correctly apply the texture when viewing the OBJ in an external 3D viewer? I appreciate any guidance, including sample code or resources! If you have a complete working solution, I’d love to discuss further via private channels.
0
0
481
Feb ’25
Very hard Watch communication after update of Xcode, MacOs, Watch OS ?
I have a swift project with a Watch companion. Since the update of Xcode in 16.3 version after updating MAcOs , Watch OS, iOS to the latest version . It is quasi impossible for me to make Xcode work with my series 10 Watch. I have a lot of alert box, messages in the "device & Simulator" tool like this Previous preparation error: A connection to this device could not be established.; Timed out while attempting to establish tunnel using negotiated network parameters. And many message telling me that Xcode is preparing the Watch , then that it has lost the connexion. I have to wait some minutes after EACH run of the App to test it again. This is very annoying . Some of the alerts I have : And the best to know , is that I can run the APP outside of Xcode , it works, Connects to the iPhone, fetch data and so. the iPhone sees the Watch without and problem. Reboots can solve for a few minutes the problem. But that is not a solution.
0
0
120
Apr ’25
Preview broken
Hello, I am doing the SwiftUI tutorial with Xcode 16.2 For the watch app the simulator working fine but the preview keep saying “This app cannot run on the selected target device.” while the preview is working …… For the macOS part the simulator working fine but the preview is totally broken with -> ”ContentView.swift” not found in any targets. While it is correctly added to the target … Please fix or make tutorial clear.
0
0
158
Feb ’25
Info.plist unable to install - With Firebase Framework & Package Manager
I'm having trouble with this Info.plist for Firebase Frameworks/FirebaseFirestoreInternal.framework/Info.plist unable to install It looks like Firebase removed Info.plist files in 10.20.0. and its causing this error below. Most of the online support says to update Cocafile PODs to not embed however I can't find any solutions for Package Manager. StackOverflow: https://stackoverflow.com/questions/64977628/all-framework-error-when-launch-framework-info-plist-no-such-file-or-directory/64979956#64979956 https://stackoverflow.com/questions/77888962/issue-trying-to-run-app-on-ios-simulator-missing-a-plist-from-firebase Error: App installation failed: Unable to Install “Replayology” Please try again later. Failed to load Info.plist from bundle at path /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework; Extra info about "/Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist": Couldn't stat /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist: No such file or directory Details App installation failed: Unable to Install “Replayology” Domain: IXUserPresentableErrorDomain Code: 1 Failure Reason: Please try again later. Recovery Suggestion: Failed to load Info.plist from bundle at path /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework; Extra info about "/Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist": Couldn't stat /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist: No such file or directory User Info: { DVTErrorCreationDateKey = "2025-05-29 23:54:11 +0000"; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; SimCallingSelector = "installApplication:withOptions:error:"; } Unable to Install “Replayology” Domain: IXUserPresentableErrorDomain Code: 1 Failure Reason: Please try again later. Recovery Suggestion: Failed to load Info.plist from bundle at path /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework; Extra info about "/Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist": Couldn't stat /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist: No such file or directory Failed to load Info.plist from bundle at path /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework; Extra info about "/Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist": Couldn't stat /Users/chronicler/Library/Developer/CoreSimulator/Devices/A087805B-77FD-446A-96C5-9DCE2F813D60/data/Library/Caches/com.apple.mobile.installd.staging/temp.YGB5zA/extracted/Replayology.app/Frameworks/FirebaseFirestoreInternal.framework/Info.plist: No such file or directory Domain: MIInstallerErrorDomain Code: 35 User Info: { FunctionName = "-[MIBundle _validateWithError:]"; LegacyErrorString = PackageInspectionFailed; SourceFileLine = 64; } System Information macOS Version 15.2 (Build 24C101) Xcode 16.3 (23785) (Build 16E140) Timestamp: 2025-05-29T18:54:11-05:00
0
0
110
May ’25
The behavior of the app using the Promises library changes between Xcode 15.4 and Xcode 16.2.
I’m creating code that performs asynchronous processing using the Promises library (https://github.com/google/promises). In this context, when building the app in Xcode 15.4 and Xcode 16.2, the behavior differs between the two. I’m using version 2.1.1 of the library. Also, I’ve tried using the latest version, 2.4.0, but the result was the same. Has anyone encountered the same issue or know an effective solution? Here's a simple code that reproduces this issue. @IBAction func tapButton(_: UIButton) { _ = getInfo() } func getInfo() -> Promise<Void> { Promise(on: .global(qos: .background)) { fulfill, _ in self.callApi() .then { apiResult -> Promise<ApiResult> in print("\(#function), first apiResult: \(apiResult)") return self.callApi() // #1 } .then { apiResult in print("\(#function), second apiResult: \(apiResult)") // #2 fulfill(()) } } } func callApi() -> Promise<ApiResult> { Promise(on: .global(qos: .background)) { fulfill, _ in print("\(#function), start") self.wait(3) .then { _ in let apiResult = ApiResult(message: "success") print("\(#function), end") fulfill(apiResult) } } } struct ApiResult: Codable { var message: String enum CodingKeys: String, CodingKey { case message } } The Swift Language version in the build settings is 5.0. The console output when running the above code is as follows: When built with Xcode 15.4: 2025/03/21 10:10:46.248 callApi(), start 2025/03/21 10:10:46.248 wait 3.0 sec 2025/03/21 10:10:49.515 callApi(), end 2025/03/21 10:10:49.535 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 10:10:49.535 callApi(), start 2025/03/21 10:10:49.536 wait 3.0 sec 2025/03/21 10:10:52.831 callApi(), end 2025/03/21 10:10:52.832 getDeviceInfo(), second apiResult: ApiResult(message: "success") The process proceeds from #1 to #2 after completing the code comment in #1. When built with Xcode 16.2: 2025/03/21 09:45:33.399 callApi(), start 2025/03/21 09:45:33.400 wait 3.0 sec 2025/03/21 09:45:36.648 callApi(), end 2025/03/21 09:45:36.666 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 09:45:36.666 callApi(), start 2025/03/21 09:45:36.666 wait 3.0 sec 2025/03/21 09:45:36.677 getDeviceInfo(), second apiResult: Pending: ApiResult 2025/03/21 09:45:39.933 callApi(), end The process does not wait for the code comment in #1 to finish and outputs the #2 print statement first. Additionally, even with Xcode 16.2, when changing the #2 line to "print("(#function), second apiResult: (apiResult.message)")", the output becomes as follows. From this, it seems that referencing the ApiResult type, which is not a String, might have some effect on the behavior. 2025/03/21 10:05:42.129 callApi(), start 2025/03/21 10:05:42.131 wait 3.0 sec 2025/03/21 10:05:45.419 callApi(), end 2025/03/21 10:05:45.437 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 10:05:45.437 callApi(), start 2025/03/21 10:05:45.437 wait 3.0 sec 2025/03/21 10:05:48.706 callApi(), end 2025/03/21 10:05:48.707 getDeviceInfo(), second apiResult: success Thank you in advance
0
0
158
Mar ’25