Search results for

Xcode

92,317 results found

Post

Replies

Boosts

Views

Activity

Side-by-side comparison in source code changes view
I am trying to move over from AppCode/Intellij to Xcode. I am however having a hard time with the version control tools. I know that you can choose side-by-side when you activate code review and select single files. However, if you go into changes and view the list of files that have changed, i can only get inline-view to work. This is really frustrating to me, is there any way to get side-by-side also when you select a file from the changes list? Cheers
1
0
114
3w
Code Coverage Not Accurate in Xcode 26
Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions. In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%. Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report? Environment: Xcode 26 iOS 18 SDK Unit tests running under XCTest Any insights or suggestions would be appreciated.
1
0
234
3w
Unable to Download iOS Simulator Runtime 26.1 on Xcode — Bad URL Error (Code 49)
Hi everyone, I’m experiencing a persistent issue when trying to download the iOS Simulator Runtime 26.1 on Xcode (version 26.1). The download always fails with the following error Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 I’m located in Brazil, so I initially thought it might be region-related, but I’ve already tried several attempts to fix it, including: Using VPNs for the US and Europe Installing the Xcode 26.2 beta Downgrading Xcode to earlier versions Reinstalling the same version of Xcode Restarting Xcode and my Mac Switching networks Clearing simulator support/device files Unfortunately, nothing has resolved the issue. Is anyone else facing this problem? Does anyone know a workaround or a manual way to download/install the iOS 26.1 simulator runtime? Thanks in advance!
2
0
442
3w
Reply to NotificationCenter Crash On iOS 18+ Swift6.2
You were right. We've found out that the issue was that we registered an observer with addObserver using a #selector that pointed to a function marked as @MainActor, but we were calling the NotificationCenter.post method from a background thread. Apparently this caused the main-actor isolation check to fail, which led to a crash. Even though there is no data-race or UI operation in the function, looks like it is enough for the function to be @MainActor to cause a crash when called from outside the main thread. We fixed it by making sure the relevant NotificationCenter.post calls are executed on the main thread. Initially, we thought that marking the function with @MainActor would prevent it from being called from a nonisolated context by producing a compile-time error in Swift 6 mode. But since a Selector instance is not aware of the actor isolation of the target function, Xcode is not able to show a warning and it caused us to not realize the issue at first. I appreciate your guidance @DTS Engineer.
Topic: Programming Languages SubTopic: Swift Tags:
3w
Potential Structural Swift Concurrency Issue: unsafeForcedSync called from Swift Concurrent context
I occasionally get this error in Xcode’s console: Potential Structural Swift Concurrency Issue: unsafeForcedSync called from Swift Concurrent context. What does this mean, and how can I resolve it? Googling it doesn’t turn up any results. This doesn't crash the app - it’s just an error diagnostic that I see in the Xcode console. The app keeps running before and after the issue. Is there a way I can set a breakpoint to catch this where it happens?
8
0
2.0k
3w
SwiftUI Sheet view with @Query loses model context
I've run into a strange issue. If a sheet loads a view that has a SwiftData @Query, and there is an if statement in the view body, I get the following error when running an iOS targetted SwiftUI app under MacOS 26.1: Set a .modelContext in view's environment to use Query While the view actually ends up loading the correct data, before it does, it ends up re-creating the sqlite store (opening as /dev/null). The strange thing is that this only happens if there is an if statement in the body. The statement need not ever evaluate true, but it causes the issue. Here's an example. It's based on the default xcode new iOS project w/ SwiftData: struct ContentView: View { @State private var isShowingSheet = false var body: some View { Button(action: { isShowingSheet.toggle() }) { Text(Show Sheet) } .sheet(isPresented: $isShowingSheet, onDismiss: didDismiss) { VStack { ContentSheetView() } } } func didDismiss() { } } struct ContentSheetView: View { @Environment(.modelContext) private var modelContext @Query pub
2
0
175
3w
Reply to .glasseffect with multiple date pickers
Thanks for the post and the description. Never seen this, so I don't think is a bug, what version of Xcode are you using? Have you updated to the latest? Could you please provide a list of the macOS, Xcode, and simulator/physical device versions? Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project. Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
3w
Reply to FoundationModel, context length, and testing
Hi I share the code of function that launches the stream query: func lanzarPeticion() async{ defer{👎🔘lanzarConsulta.toggle()} do { let sessionStream = LanguageModelSession(model: modelStream, instructions: instructions) let genOptions = generarSamplingMode(temperatura: temperatura, maxResponseTokens: maxResponseTokens, probabilityThreshold: probabilityThreshold, topK: topK, seed: semilla) let responseStream = sessionStream.streamResponse( to: prompt, options: genOptions) for try await partial in responseStream { withAnimation{ self.respuesta = partial.content t.createPartialTime() } } withAnimation{ t.stop() } } catch { // all the logic for errors } } Clarifications about the code: First of all, English is dominant on code but sometimes use Spanish, my native language, specially when terms overlap swift or framework ones; I have my own emoji rules to avoid characters an improve readability (at this moment I'm indie developer so I set the rules) The defer block is to free the button that launches the request
3w
Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
I’m building a React Native 0.72.10 iOS app and hitting build errors. Environment: macOS: Apple M4, Sequoia 15.7.2 Xcode: 26.1.1 React Native: 0.72.10 Errors: Could not delete /Users/.../ios/build because it was not created by the build system Unable to write file '/Users/.../ios/build/Pods.build/Debug-iphonesimulator/...': Operation not permitted (Multiple Pods / React Native framework headers affected) What I’ve tried: bash rm -rf ios/build rm -rf ~/Library/Developer/Xcode/DerivedData xattr -w com.apple.xcode.CreatedByBuildSystem true ios/build pod deintegrate && pod install sudo chown -R $(whoami) ios/build Observations: ios/build is recreated automatically. Some files have com.apple.xcode.CreatedByBuildSystem: true. 3.Xcode have Full disk access authorisation. Why does Xcode fail to delete / write to ios/build even though it’s recreated automatically by the build system? Is this caused by Xcode itself, macOS permissions? Any recommended fix or workaroun
1
0
130
3w
Reply to Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
Thanks for the post, I am not familiar with the third party React Native. You should check with the support resources provided by the 3rd party to get assistance with their software. Unless another developer in the forums has experience with the third-party and can provide assistance. My sole recommendation is to ensure that your macOS is updated to the most recent version, as well as your Xcode. Additionally, I suggest contacting React Native support to inquire if they have encountered similar issues. Good luck. Albert Pascual
  Worldwide Developer Relations.
3w