Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
20 views

I’m running into a crash when trying to sync cookies from my app to a WKWebView’s HTTPCookieStore. The crash happens at the setCookie call inside an async function. I’m not sure why it’s happening. ...
jieun's user avatar
  • 1
-1 votes
1 answer
47 views

I’m using Swift’s new Observation framework to create an AsyncStream that reacts to changes in an observable object. The stream should emit new values whenever a tracked property changes and ...
Tiny Tim's user avatar
  • 271
1 vote
1 answer
61 views

When writing new async/await code that makes use of an existing completion-based service, I've found it is necessary to wrap the call to continuation.resume(with:) in what feels like a redundant ...
Chris's user avatar
  • 3,879
1 vote
1 answer
89 views

I am trying to adapt C code, measuring pre/after main time, so it could be accessed from Swift with SC on. But nothing can silent compiler warning, indicating this code is not safe. I've tried every ...
JuicyFruit's user avatar
  • 2,690
0 votes
0 answers
92 views

For authentication in my Swift 6 app I use the AppAuth library. One of the steps in authenticating a user involves fetching the OIDC configuration. The library offers a way to do so which involves a ...
Pieter's user avatar
  • 275
0 votes
0 answers
44 views

I’m migrating a small SwiftData model from Swift 5 to Swift 6. The same code compiles under Swift 5, but with Swift 6 it fails when the @Model macro expands a property whose type conforms to Codable. ...
markb's user avatar
  • 1,381
-1 votes
1 answer
150 views

I have a feeling that Swift Concurrency is fighting agains me all the time. It is really frustrating. My problem. I need to create Combine publisher to emit battery state on iOS device. So far I have ...
Marcin Kapusta's user avatar
1 vote
1 answer
317 views

I have two SwiftUI views and a @MainActor protocol for handling navigation events. I’m trying to pass a method reference directly into an escaping closure, but the compiler complains: Task-isolated ‘...
user2037296's user avatar
1 vote
1 answer
109 views

I have been using RxSwift for my apps before Combine, Swift Concurrency and SwiftUI. In RxSwift we can have a Signal that will just emit without replaying the previous value which is very useful to ...
Bawenang Rukmoko Pardian Putra's user avatar
1 vote
2 answers
120 views

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 ...
Benzy Neez's user avatar
  • 29.4k
1 vote
1 answer
240 views

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 ...
matt's user avatar
  • 540k
0 votes
0 answers
71 views

Trying to adapt to the Protocol generated from Kotlin Multiplatorm in Objective-C exposed to Swift. I'm learning Swift Concurrency and I'm not sure how to approach to this. Basically this protocol ...
Marcin Kapusta's user avatar
0 votes
1 answer
58 views

I'm migrating to Swift 6 and in the same time I'm trying to learn Swift Concurrency. I have the following code with the exception. I would like to understand the problem and learn how to solve this ...
Marcin Kapusta's user avatar
3 votes
2 answers
136 views

Let the code speak for itself: final class Piece: UIView { var picName: String var column: Int var row: Int override var description: String { return "picname: \(picName);...
matt's user avatar
  • 540k
1 vote
2 answers
77 views

CityView is a custom View in a demo project , But the Xcode's documents says it was a @MainActor , and CityView isn't defined as @MainActor in project . How does the Xcode's help document knows it was ...
ximmyxiao's user avatar
  • 2,923
1 vote
1 answer
95 views

The Swift 6 compiler emits the following error Sending value of non-Sendable type '() async throws -> ()' risks causing data races when explicitly specifying an actor as the isolation for the ...
CouchDeveloper's user avatar
0 votes
1 answer
143 views

I'm working on a Swift application where I need to manage a piece of data (e.g., a CGRect representing a rectangle's position) that can be modified on a background thread/task, while concurrently ...
SWNS's user avatar
  • 11
2 votes
1 answer
138 views

Is there a mechanism, like the @MainActor tag, where we can specify a shared non-main thread that designated classes are on? I would like to be able to setup something like: @AnimalsActor final class ...
Grant Neufeld's user avatar
1 vote
1 answer
452 views

I tried to make as simple example as possible using Swift 6 to produce this problem which I am having difficulty to solve: func getValue() async -> Int { 0 } func getValuePublisher() -> ...
Matic Oblak's user avatar
  • 16.9k
-2 votes
2 answers
292 views

I have two use cases: offloading heavy work from the UI thread to keep the UI smooth. Perform searching while user is typing. extension MoveNoteViewController: UISearchBarDelegate { // Busy ...
Cheok Yan Cheng's user avatar
0 votes
1 answer
73 views

I am listening to voiceover changes through NSWorkspace KVO and here is my code public final class MyContext: ObservableObject { public weak var actionHandler: ActionHandler? public weak var ...
rottweiler's user avatar
  • 1,223
2 votes
2 answers
563 views

I have this code below and the compiler throws me an error at line "continuation.resume(returning: result)", saying "sending result risks causing data races" How can I fix this? I ...
user29816220's user avatar
2 votes
1 answer
294 views

I’m encountering an error when mixing @MainActor and nonisolated, particularly when a @MainActor nonisolated property accesses a nonisolated property from a @MainActor protocol. The code is Example 1 @...
ukim's user avatar
  • 2,487
0 votes
1 answer
140 views

I have the following SwiftUI Observable model class along with a local & global actor variables that fails to build with the error Global actor 'MyGlobalActor'-isolated default value in a ...
Deepak Sharma's user avatar
-1 votes
2 answers
93 views

What is the rationale behind Swift compiler being overly strict about Protocol conformances? For instance, consider the following code: protocol TestProtocol { func testFunction() } actor ...
Deepak Sharma's user avatar

1
2 3 4 5
8