120 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
99
views
Complete SWIFT_STRICT_CONCURRENCY does not show errors for non thread-safe code
I have a project where I want to see Swift 6 warnings. This is my setup.
Using Swift 6:
> git grep "SWIFT_VERSION"
xx.xcodeproj/project.pbxproj: SWIFT_VERSION = 6....
0
votes
1
answer
50
views
SwiftData iOS 26: Model inheritance breaks when another model has relationships to the parent class
I'm testing SwiftData model inheritance (new in iOS 26) and encountering a crash when combining:
A model that inherits from another model
A separate model with relationships to the parent class
...
0
votes
2
answers
68
views
Swift Package Manager hangs on incremental builds (Swift 6.2, Linux Ubuntu 24.04)
I'm experiencing an issue where Swift Package Manager hangs indefinitely during incremental builds on Linux with Swift 6.2.
Environment
Swift: 6.2 (swift-6.2-RELEASE)
OS: Ubuntu 24.04.3 LTS
Kernel: ...
Best practices
1
vote
2
replies
75
views
What is the best pattern for SwiftUI Document Application?
I am trying to create a full SwiftUI Document app (using swift 6, as it matters).
Apple doc says that the Document init(configuration:)and fileWrapper(configuration:)are called on a background thread -...
Best practices
0
votes
0
replies
27
views
Swift6 concurrency checking how to get actor data synchronized mode?
I have an actor with some values. I understand that if I want to get it, I need to actor isolate the data, but I want to use it in a class where I also need the data synchronously so I made a ...
1
vote
1
answer
96
views
Swift/objc interoperability and modern swift concurrency
How to resolve error:
Non-Sendable parameter type BookInfo of actor-isolated @objc instance method cannot cross actor boundary?
BookStore.swift:
// manage state of instances of BookInfo
@objc actor ...
2
votes
1
answer
179
views
PHPhotoLibrary.shared().performChanges crashes when trying to save image to photo library
I'm using PHPhotoLibrary.shared().performChanges {} to save an image to the photo library. The code works at Swift 5, however when switching to Swift 6 and clicking the save button I'm receiving the ...
2
votes
1
answer
272
views
Why does @Model conformance to PersistentModel and Hashable cross into @MainActor isolation in Swift 6.2?
I’m using Swift 6.2 with MainActor set as the default global actor in my project.
When I create a SwiftData @Model that conforms to a protocol extending PersistentModel, I get actor isolation errors ...
0
votes
1
answer
128
views
How to solve "Actor-isolated property 'session' can not be mutated from the main actor"
I am working on a Swift 6 project where I am using an actor called NetworkService.
I need to inject a URLSessionProtocol instance into its initializer because I am using dependency injection, which ...
0
votes
0
answers
61
views
AVAudioEngine mic input tap not receiving buffer data in Swift 6
In Swift 6, our AVAudioEngine volume tap on the microphone input isn't receiving any buffer data.
The following code starts with Audio engine started, microphone is active. but print("buffer&...
0
votes
1
answer
43
views
MPMediaLibrary.requestAuthorization { } Crashes app at Swift6
To be able to use MPMusicPlayerController.systemMusicPlayer, I was using the code below to request authorization if we get status ( let status = MPMediaLibrary.authorizationStatus() ) was ...
Hope's user avatar
- 2,420
1
vote
2
answers
127
views
How to pass a function returning `some View` as parameter to `sheet(item:onDismiss:content:)`
I am using the modifier sheet(item:onDismiss:content:) to show a sheet, where the content of the sheet depends on the item that is passed as parameter. The body of the sheet is built using a function ...
1
vote
1
answer
52
views
Swift6 variable gives @Sendable in RealityKit animation
I have this animation function in Swift6 RealityKit application. It puts given entity softly in scene. It works.
But I am getting Capture of 'simpleMaterial' with non-sendable type 'SimpleMaterial' in ...
-1
votes
0
answers
38
views
Swift 6 only Combine crash [duplicate]
@globalActor
public struct TestGlobalActor {
public actor ActorType { }
public static let shared: ActorType = ActorType()
}
final class TestCrash: XCTestCase {
let subject = ...
1
vote
1
answer
301
views
Passing closure risks causing data races
I know this sort of thing has been asked and answered before — see, for example, Swift 6 warnings "Passing closure as a 'sending' parameter risks causing data races" — but I still ...