Search results for

Swift 6

49,200 results found

Post

Replies

Boosts

Views

Activity

Reply to SwiftData Fatal error: Editors must register their identifiers before invoking operations on this store
Do you have a full symbolicated crash report to share? You can include crash reports directly in your post using the forums attachment feature. For any random crash related to SwiftData / Core Data, I'd suggest that you add com.apple.CoreData.ConcurrencyDebug 1 as a launch argument of the app to check if there is any violation, as discussed here. Also, I guess ConsumptionSession is Sendable? Otherwise, Xcode will give you an error if you compile with Swift 6. If you haven't used Swift 6, I'd suggest that you give it a try to see if that unveils any race condition. Best, —— Ziqiao Chen  Worldwide Developer Relations.
2w
Reply to Should ModelActor be used to populate a view?
It's unclear what LabResultDto in the code snippet is. If it is a Sendable type that wraps the data in a SwiftData model, that's fine; if it is a SwiftData model type, because a SwiftData model object is not Sendable, you won't want to pass it across actors – Otherwise, Swift 6 compiler will give you an error. For more information about this topic, see the discussion here. When using SwiftData + SwiftUI, I typically use @Query to create a result set for a view. Under the hood (of @Query), the query controller should be able to detect the changes you made from within a model actor, and trigger a SwiftUI update. Fore more information about observing SwiftData changes, see this WWDC25 video. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2w
Native Crash - Unknown Function (/usr/lib/system/libsystem_kernel.dylib) Unknown Function (/usr/lib/system/libsystem_kernel.dylib)
Hi, I encountered the following error while trying to launch a video game developed with Unity and running on an iPhone 12 and iPhone 16 Pro. Native StackTrace: Thread 2 (crashed) 0 libsystem_kernel.dylib 0x00000001d40102ec 1 libsystem_c.dylib 0x000000019330fba0 2 UnityFramework 0x000000010e7bc744 3 UnityFramework 0x000000010dc1c22c 4 UnityFramework 0x000000010cc26da4 5 CoreFoundation 0x000000018b4af984 6 libobjc.A.dylib 0x0000000183277140 7 libc++abi.dylib 0x00000001e7d20068 8 libc++abi.dylib 0x00000001e7d2000c 9 libdispatch.dylib 0x0000000193256de8 10 libdispatch.dylib 0x000000019325e400 11 libdispatch.dylib 0x000000019325ef30 12 libdispatch.dylib 0x0000000193269cb4 13 libdispatch.dylib 0x0000000193269528 14 libsystem_pthread.dylib 0x00000001e7e00934 15 libsystem_pthread.dylib 0x00000001e7dfd0cc
5
0
90
2w
Swift Testing Failed to complete Unit Tests -> not enough values to unpack (expected 2, got 1)
I’m migrating some XCTest cases to Swift Testing and hit a runtime error when using tuple arguments within the CI. I don't have an issue when running locally. [2025-08-21 14:22:13.493] [unit_tests] [WARNING] Could not find test status list for -[FooManagerTests testEndpoint(region:enforce:expectedEndpoint:)] [2025-08-21 14:22:18.054] [unit_tests] [ERROR] not enough values to unpack (expected 2, got 1) ##[error]Failed to complete Unit Tests -> not enough values to unpack (expected @Test(Telemetry endpoint routing, arguments: [ (TelemetryRegion.value1, false, Foo.someValue1), (TelemetryRegion.value2, false, Foo.someValue2), (TelemetryRegion.value3, true, Foo.someValue3), (TelemetryRegion.value4, false, Foo.someValue4), ]) func testEndpoint(region: enforce: expectedEndpoint: ) { ... }
0
0
63
2w
Reply to SwiftData initializing Optional Array to Empty Array
What you observed is the behavior that the framework currently has – If you save the model context right after adding a book, you will see that the relationship turns from nil to [] immediately, and that's because SwiftData makes the change when persisting the model. SwiftData does that because the default store (DefaultStore) is based on Core Data, and Core Data expresses an empty toMany relationship with an empty set. (Core Data had been implemented with Objective C long before Swift was introduced.) Having said that, if you have a different opinion about the behavior, feel free to file a feedback report – If you do so, please share your report ID here. Thanks. Best, —— Ziqiao Chen  Worldwide Developer Relations.
2w
Reply to iOS 26 Beta breaks scroll/gesture in SwiftUI chat (worked in iOS 18): Simultaneous gestures & ScrollViewReader issues
I’m also seeing this issue on my end. In our app we use Swift Charts inside a ScrollView, with simultaneous gestures applied in the chart’s overlay block (for interactions like drag/tap on data points). Since iOS 26 beta 1, this completely breaks the parent ScrollView’s vertical scrolling. This was never a problem on iOS 18, the exact same code works fine there. I also noticed that the release notes for beta 5 and beta 6 mention fixes for simultaneousGesture conflicts in scroll views, but this bug is still reproducible. So unfortunately, it’s not fixed yet, and I haven’t found a workaround so far.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2w
Reply to mTLS : Guidance on Generating SecIdentity with Existing Private Key and Certificate
Step 6 - Get a digital identity from the keychain: private func getClientIdentity() -> SecIdentity? { let query: [String: Any] = [ kSecClass as String: kSecClassIdentity, kSecAttrLabel as String: MTLSTag.clientcert, // <-- match by certificate tag kSecReturnRef as String: true, kSecMatchLimit as String: kSecMatchLimitOne ] var identityRef: CFTypeRef? let status = SecItemCopyMatching(query as CFDictionary, &identityRef) if status == errSecSuccess, let identity = identityRef as! SecIdentity? { print(Retrieved client identity from Keychain) return identity } else { print(Could not retrieve client identity, status=(status)) return nil } } Usages : func updateCertificates() { // Load CA certificates (if needed for server trust validation) self.trustedCACerts = CertificateUtils.getCACertificates() self.storeCertificatesInKeychain() if let useridentity = self.getClientIdentity() { self.clientCredential = URLCredential(identity: useridentity, certificates: nil, persistence: .forSession) } }
2w
Reply to mTLS : Guidance on Generating SecIdentity with Existing Private Key and Certificate
Hello, Thank you for sharing the provided solution. I followed all the steps and used the same API set. However, while retrieving the SecIdentity using the certificate fetch API SecItemCopyMatching, I am encountering the following error: Error: Could not retrieve client identity, status = -25300 Please find the relevant code snippets below: Step 1 to 3 : Generate the private key in the keychain. Derive the public key from the private key. Export the public key bits and send that your certificate issuing infrastructure. func generateCSR(_ deviceId: String? = UserProfile.deviceId) -> String? { do { // Define subject DN for CSR let subject = try DistinguishedName([ .init(type: .NameAttributes.countryName, printableString: US), .init(type: .NameAttributes.stateOrProvinceName, printableString: stateProvince_Name), .init(type: .NameAttributes.localityName, printableString: locality_Name), .init(type: .NameAttributes.organizationName, printableString: organization_Name), .init(type: .NameAttributes.organizational
2w
Reply to Push Notification Delivery Delays and Failures on iOS Devices
When my app is in the foreground, I receive the notification at 12:13 PM (Indian Standard Time), with the APNs device token: 2bffe3f3800cd7ed7e599495e48051aa1f457ba7de52ea14ddd363bf373d3b08. However, after 6 hours, when I attempt to send a push notification at 6:00 PM (Indian Standard Time), I do not receive the notification, despite using the same APNs device token: 2bffe3f3800cd7ed7e599495e48051aa1f457ba7de52ea14ddd363bf373d3b08.
2w
Reply to iOS 18 CoreFoundation crash in __CFRunLoopServiceMachPort (EXC_BREAKPOINT SIGTRAP)
You’re using a third-party crash reporter and it’s undermining your ability to debug this issue. This is not uncommon. I discuss this in way too much detail in Implementing Your Own Crash Reporter. My advice is that you remove your third-party crash reporter and then wait for new Apple crash reports to arrive. To illustrate the sorts of problems I’m talking about here, let me pull apart that second crash report, starting with this: Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 0 This shows that your process crashed due to a memory access exception. That it, it was running some code that accessed an invalid memory location. Let’s look at the backtrace of the crashing thread: Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib … mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib … mach_msg2_internal + 76 (mach_msg.c:201) 2 libsystem_kernel.dylib … mach_msg_overwrite + 428 (mach_msg.c:0) 3 libsystem_kernel.dylib … mach_msg + 24 (mach_msg.c:3
Topic: App & System Services SubTopic: General Tags:
2w
App name not localized
Now using Xcode 26 beta 6, and iOS/iPadOS 26 beta 7 - and I found the codes do not compiled with localized name. Since I have been buidling the codes since beta 1, the app might have localized name in the past. Even Localizable file is there with proper translation. I have however, started to build icon using Icon Composer (before that was not). I have also tried to add in CFBundleDisplayName and CFBundleName in Localizable file, and same (English is shown). What have I done wrong or forget to do?
1
0
53
2w
Reply to UISlider valueChanged has uninitialized UIEvent
@DTS Engineer unfortunately yes. I reproduced with Xcode 26 beta 6 (17A5305f) and an iPad running iOS 26 beta 7 (23A5326a). The following code will produce the runtime exception. slider.addTarget( self, action: #selector(sliderValueDidChange(_:for:)), for: .valueChanged ) // ... @objc func sliderValueDidChange(_ sender: UISlider, for event: UIEvent) { print(event) } whereas changing the event parameter type to UIControl.Event doesn't produce it: @objc func sliderValueDidChange(_ sender: UISlider, for event: UIControl.Event) { print(event) } Do note that changing the action method body to @objc func sliderValueDidChange(_ sender: UISlider, for event: UIEvent) { print(Event: (event)) } has always been working fine, but that is because the String interpolation treats the event value as nil I believe (by printing an empty String).
Topic: UI Frameworks SubTopic: UIKit Tags:
2w
SwiftSupport is missing
I'm trying to distribute an app for internal testing but I'm always getting the below error and the SwiftSupport folder is not created although I tried different fixes/configurations. How can I debug/see the reason why the SwiftSupport folder is not generated? Xcode 16.4 Build version 16F6 I tried distributing from the Transporter, Xcode organizer, I tried to archive it both from Xcode and from the command line. There are a couple of answers on StackOverflow, nothing helped. What could be the problem? One of the things I tried: xcodebuild -project PhotoBook.xcodeproj -scheme PhotoBook -configuration Release -archivePath Release/PhotoBook.xcarchive -destination 'generic/platform=iOS' -verbose archive xcodebuild -exportArchive -archivePath Release/PhotoBook.xcarchive -exportPath Release -exportOptionsPlist ExportOptions.plist -destination 'generic/platform=iOS' -verbose ExportOptions.plist method app-store-connect teamID T672CQXP54 uploadSymbols uploadBitcode signingStyle manual provisioningP
0
0
27
2w
Reply to iOS 26 Beta breaks scroll/gesture in SwiftUI chat (worked in iOS 18): Simultaneous gestures & ScrollViewReader issues
I can confirm the same issue on iOS 26 beta 6. We have been using simultaneousGesture() as a workaround for the well-known bug, which is the same one BAR115 mentioned earlier. However, this workaround appears to be broken as well. At the moment, it seems there is no reliable way to use buttons inside sheets. This is just ridiculous.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2w