Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
96 views

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 ...
1 vote
1 answer
62 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 ...
0 votes
0 answers
65 views

I’m migrating an OAuth sign‐in feature to Swift 6. The view model stores the discovery configuration as a @MainActor property: @Observable class AuthModel { @MainActor var configuration: ...
1 vote
1 answer
94 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 ...
0 votes
0 answers
61 views

I extended String with a pure function that copies a prefix of up to maxLength characters. The code below produces a build error: Call to main actor-isolated instance method 'copiedPrefix' in a ...
Erik's user avatar
  • 2,148
0 votes
0 answers
108 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 ...
3 votes
1 answer
244 views

Consider following code: class MyViewController: UIViewController { var callback: (() -> Void)? func setCallback(_ callback: (() -> Void)?) { self.callback = callback ...
0 votes
1 answer
138 views

I have such protocol not owned by my codebase. It came from library. I extracted it to bare minimum just to focus on one problem. protocol BatteryLevelProvider { func getBatteryLevel() -> Float ...
-1 votes
1 answer
172 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 ...
2 votes
3 answers
411 views

I have a simple view model like this: import Foundation import SwiftUI typealias MessagePollResult = Result<[Message], Error> @MainActor final class ChatScreenViewModel: ObservableObject { ...
1 vote
1 answer
413 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 ‘...
2 votes
1 answer
73 views

How Actor can Conform to protocol and mutate its internal state in nonisolated method that is required by this protocol. There is no write access in nonisolated method to isolated property by actor. ...
1 vote
1 answer
120 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 ...
-1 votes
1 answer
88 views

I have following case. NotMyProtocol is from external library. It is not suitable to work with Swift Concurrency so I though some way to implement it and I will pass some proxy into it to forward ...
1 vote
2 answers
127 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 ...

15 30 50 per page
1
2 3 4 5
...
25

AltStyle によって変換されたページ (->オリジナル) /