1

If you execute in Linux swift project something like:

import PromiseKit

func runAsyncAction() {
    firstly {
        executeSomePromiseFunc()
    }.done {
        getResult($0)
    }
}

getResult($0) will never be executed. Why?

Serhii Didanov
  • 2,200
  • 1
  • 16
  • 31

1 Answers1

1

In Linux swift project you need to use:

import PromiseKit
import Dispatch

func runAsyncAction() {
    firstly {
        executeSomePromiseFunc()
    }.done(on:DispatchQueue.global()) {
        getResult($0)
    }.ensure(on:DispatchQueue.global()) {

    }.catch(on:DispatchQueue.global()) {

    }
}

PS. Works on Ubuntu 16.04, Swift 4.2

Serhii Didanov
  • 2,200
  • 1
  • 16
  • 31