You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run an asynchronous task in SwiftUI, however, I'm failing to do so because the SDK is using the same name as Apple's framework. You structure your code as follows in swift to run an asynchronous task:
Task{
await myAsycFunc()
}
The conflict arises from this file Graph.Task.swift . It has the following protocol definition:
public protocol Task {
/// Starts the underlying task
func resume()
/// Cancel the underlying task
func cancel()
}
My error then becomes: 'any Task' cannot be constructed because it has no accessible initializers
The text was updated successfully, but these errors were encountered:
@cocoahero this is a pretty tricky issue, causing build errors for anyone using async commands in Swift with the Task<Success, Failure> struct from the Concurrency framework.
I know it's annoying, but if this could be renamed to something like BuyDataTask or something else that would be more appropriate in the next version that would be great. IMO "Task", and also "Graph" are a bit too generic to be public classes.
Hi,
I'm trying to run an asynchronous task in SwiftUI, however, I'm failing to do so because the SDK is using the same name as Apple's framework. You structure your code as follows in swift to run an asynchronous task:
The conflict arises from this file Graph.Task.swift . It has the following protocol definition:
My error then becomes: 'any Task' cannot be constructed because it has no accessible initializers
The text was updated successfully, but these errors were encountered: