BoltsFramework / Bolts-ObjC

Bolts is a collection of low-level libraries designed to make developing mobile apps easier.
Other
5.65k stars 578 forks source link

``` #327

Closed cavinkraiter closed 4 years ago

cavinkraiter commented 5 years ago
    var tasks = [BFTask<AnyObject>]()
    let allTask = BFTask(forCompletionOfAllTasks: tasks)

does not work...

Originally posted by @nishidanagisa in https://github.com/BoltsFramework/Bolts-ObjC/issues/279#issuecomment-251849364

georgesjamous commented 5 years ago

Why not use BoltsFramework/Bolts-Swift](https://github.com/BoltsFramework/Bolts-Swift)

        var tasks: [Task<Void>] = [
            Task<Void>.withDelay(1),
            Task<Void>.withDelay(2),
            Task<Void>.withDelay(3),
            Task<Void>.withDelay(4)
        ]
        let allTask = Task.whenAll(tasks)
nlutsenko commented 4 years ago

As @georgesjamous outlined, for Swift native support, Bolts-Swift is indeed much better.

If you can write a test that fails and send it in a form of pull request - I'll happily help figure out how to bridge nicer here, but all in all, we are quite limited in what we can do with automatic type conversion/resolution from ObjC to Swift.