google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'FBLPromise' requires that '***' be a class type

petrovi4 opened this issue · comments

First of all, the link https://github.com/google/promises/blob/master/g3doc/index.md for Swift, examples are

import Promises
...
func data(at url: URL) -> Promise<Data>

and so on, although in reality the module is called FBLPromises, just like the class. That is, the documentation is not consistent.
But this is minor.

The documentation shows examples of creating Promise, while promise only requires class type. I.e., the code

let promise = FBLPromise<String> { fulfill, reject in
  ...
}

not compiled with error: "'FBLPromise' requires that 'String' be a class type"

I'm doing something wrong, or do not use FBLPromises with objects that aren't classes?
If this is the case, most of the promises usage scenario is lost, and for many, the benefit of using the library tends to zero.

Ps. I use Carthage

Hi @petrovi4, the documentation is correct, you should be importing Promises. What issue do you face when importing the right module?

Hi @petrovi4, please reopen if you are still experiencing any issues. Thank you!