Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios PromiseKit:使用不同类型的Promise数组在(实现:)时调用_Ios_Arrays_Swift_Xcode_Promisekit - Fatal编程技术网

Ios PromiseKit:使用不同类型的Promise数组在(实现:)时调用

Ios PromiseKit:使用不同类型的Promise数组在(实现:)时调用,ios,arrays,swift,xcode,promisekit,Ios,Arrays,Swift,Xcode,Promisekit,我有一系列不同类型的承诺。在这种特殊情况下,Promise和Promise我希望在(履行时:) 例如: let fileName = "somefilename" let videos: [URL] = selectedItems.compactMap { guard $0.isVideo else {return nil}; return URL(string: $0.url) } let images: [URL] = selectedItems.compactMap { guard

我有一系列不同类型的承诺。在这种特殊情况下,
Promise
Promise
我希望在(履行时:)

例如:

let fileName = "somefilename"

 let videos: [URL] = selectedItems.compactMap { guard $0.isVideo else {return nil}; return URL(string: $0.url) }
 let images: [URL] = selectedItems.compactMap { guard !$0.isVideo else {return nil}; return URL(string: $0.url) }
 let videoRequests = videos.map { RemoteDownloadManager.shared.downloadVideo(from: $0, withName: fileName) }
 let imgRequests = images.map {RemoteDownloadManager.shared.downloadImage(from: $0)}

我有两个承诺数组,但类型不同:
[Promise]
[Promise]
when(fulfilled: [imgRequests, videoRequests])
        .done { items in
                  // [...]
}