240 questions
Best practices
1
vote
1
replies
81
views
How to step out chain of promises
I have the following code.
func myFunction() -> Promise<MyResult> {
firstly {
doSomeJob()
}.then { jobResult in
handleJobResult(jobResult)
}.then { handledResult ...
1
vote
0
answers
273
views
Fetching list of items always times out after 60 seconds
I am fetching a list of items using Alamofire and Promisekit. Some items take longer to get than others. I have set the timeout in alamoFireManager to 180 seconds, however 60 seconds after the first ...
2
votes
2
answers
275
views
Pass value over Promise in Swift
I have a Promise chain like this
firstly {
Network.shared.getInfo()
}
.then { info in
Network.shared.getUserDetail(info)
}
.then { detail in
Network.shared.getAddOn(detail)
}
.done { addOn in
...
1
vote
1
answer
606
views
Pending Task in Swift
Now I am migrating from PromiseKit to Concurrency. As I understood, I should replace Promise and Guarantee with Task. However, I cannot find a replacement for Promise<T>.pending(). Is there ...
3
votes
1
answer
1k
views
What is the Swift concurrency equivalent to a promise–resolver pair?
With the PromiseKit library, it’s possible to create a promise and a resolver function together and store them on an instance of a class:
class ExampleClass {
// Promise and resolver for the top ...
7
votes
1
answer
4k
views
Swift async/await equivalent of Promise Kit "when" pattern
I'm new to Swift, coming from JS, and I've started to build an iOS app.
Initially I went down the road, using Promise Kit for the async stuff, as it seemed easier to me than other things I read about.
...
1
vote
5
answers
6k
views
Swift equivalent of await Promise.all
I'm coming from JS and learning Swift to build an iOS native version of an app.
In JS, I use the following pattern all the time:
...
async function doAyncFunction(item) {
try {
// do async call ...
1
vote
1
answer
1k
views
How to Unit Test asynchronous functions that uses Promise Kit
Might I be so inclined to ask for a hand and or different perspectives on how to Unit Test a function on my Viewcontroller that calls an HTTP request to a Back End server using promise kit which ...
0
votes
1
answer
811
views
Code using Promises doesn't execute at all
I've spent the better part of the day banging my head against the wall over this, and I think I finally understand it. Here's the question I wish had existed this morning when I started looking.
For ...
0
votes
1
answer
907
views
Using PromiseKit I want to make multiple API calls
I'm using PromiseKit in my project and I need to do batch/multiple calls to the API and wait for all responses. Any ideas how to do this? I'm pretty new to PromiseKit, and didn't find anything ...
-1
votes
1
answer
2k
views
How to return value from Promise in swift [duplicate]
I have a function like this
func fetchPokemons() -> [Pokemon] {
var pokemons : [Pokemon] = []
service.fetchPokemons().done{ (newPokemons) in
pokemons += newPokemons.pokemons!
...
0
votes
1
answer
187
views
PromiseKit 6 iOS chaining
I am trying to chain some API calls and I think I am confusing some concepts. Would love some clarification & code samples.
I have implemented these functions...
func promiseFetchPayments(for ...
1
vote
1
answer
352
views
Use the 'asPromise ()' in the Observable RxSwift can be used in a PromiseKit Promise?
I write function 'asPromise()'
but dispose is weird, I don't better idea.
so If you have any better ideas, please let me know
thank you
1
vote
1
answer
153
views
PromiseKit Cannot invoke 'fulfill' with an argument list of type '(Data)'
I'm trying to get data from the network request using PromiseKit in the following code below, but on the line seal.fulfill(data) I'm getting the error 'Cannot invoke 'fulfill' with an argument list of ...
-1
votes
1
answer
2k
views
Response Serialization error, how to fix it?
I am trying to decode a json data, but it throws an error:
[] nw_protocol_get_quic_image_block_invoke dlopen libquic failed responseSerializationFailed(reason: Alamofire.AFError....