Group Group Group Group Group Group Group Group Group

Can't set Swift Combine Future Output Type to Void

In Swift Combine Future Publisher, I can’t set the output type value to Void

return Future<Void, Error> { (promise) in
promise(.success()) <— This line is in error
}

Missing argument for parameter #1 in call

thanks

I found it myself,

you need to call the promise this way, not really esthetic

promise(.sucess(()))

1 Like

Glad you found the solution to that.

You need the () because your Future is of type <Void, Error> if you change this, you will have to update the success param too.

This topic was automatically closed after 166 days. New replies are no longer allowed.