Questions tagged [promisekit]

PromiseKit is Objective-C and Swift Promises implementation. It is also a collection of helper functions that make the typical asynchronous patterns we use in iOS development delightful too.

Modern development is highly asynchronous: isn’t it about time iOS developers had tools that made programming asynchronously powerful, easy and delightful?

PromisesKit is not just a Promises implementation, it is also a collection of helper functions that make the typical asynchronous patterns we use in iOS development delightful too.

In addition, PromisesKit is designed to be integrated into other CocoaPods. If your library has asynchronous operations then consider adding an opt-in subspec that provides Promises for your users. Documentation to help you integrate PromiseKit into your own pods is provided later in this guide.

PromisesKit is available in Objective-C and Swift flavors.

241 questions
0
votes
1 answer

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 background, I have several years of experience…
TallChuck
  • 1,725
  • 11
  • 28
0
votes
1 answer

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 regarding this on their Github (probably didn't see or…
Mihai Fischer
  • 329
  • 2
  • 11
0
votes
1 answer

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 accountId: String) -> Promise <[OperationResponse]> { …
0
votes
2 answers

How to call recursive function with Promise Kit?

I am stuck with somewhere to call same function again in promise and because of calling multiple time it's deallocate promise. Actually in my case I have API with multiple page request and I want to call it with promise. I was implemented it as…
Dipen Chudasama
  • 3,063
  • 21
  • 42
0
votes
1 answer

Firebase Firestore fetching data with an ID reference then fetching the reference

After searching for a few hours for the answer to this question, I have found 1 post that was similar here: However I tried to replicate but I believe the difference in language syntax made it very hard to translate. Within my application, users are…
0
votes
1 answer

Swift PromiseKit. Do GET requests multiple times one by one. Pyramid of doom with PromiseKit

I am doing multiple GET requests to the URL, it returns me some JSON data, which I decode into the class. From this class I extract attribute - id: Int, this id is part of a URL which I build to make another GET Request. In other words: JSON fetched…
0
votes
1 answer

Issue To Create A Base Service

Hello everyone I want to crate a base api service for my apps but when I try a lot of different way but i can't solve my problems. I have to use alamofire, promiseKit and generic's. My first solution and his issue: I can get my json from api but…
0
votes
1 answer

Adding promises to an array and preventing them from getting resolved automatically

I wish to add an arbitrary number of promises to an array and have them resolve sequentially one after another at some point. Quick pseudo swift-code would be (without indulging more into how the promises are called sequentially): var someArray:…
strangetimes
  • 4,953
  • 1
  • 34
  • 62
0
votes
1 answer

Canceling nested Promise gives warning: "pending promise deallocated"

I have the following code snippet which gives me the warning: "pending promise deallocated", when canceling the underlying task. func pingGoogle() -> Promise { Promise { seal in firstly { …
Balázs Vincze
  • 3,550
  • 5
  • 29
  • 60
0
votes
1 answer

How can I use PromiseKit w/ Race to return the quickest result

I have a network request. I'd like to make this request and fallback to a cached value if the request fails the request takes too long I was thinking I could use race to make the request and also use after to give myself a sort of time out on the…
Harry Blue
  • 4,202
  • 10
  • 39
  • 78
0
votes
2 answers

PromiseKit no callback / deallocates? (Alamofire)

My promise chain is broken (maybe deallocated) before it's resolved. This happens (so far ONLY) when I make Alamofire request fail due to host trust evaluation -> forcing evaluation to fail which results in -999 cancelled etc). Setup is rather…
Pawel Klapuch
  • 380
  • 4
  • 15
0
votes
0 answers

How could I rewrite this using PromiseKit?

I have a pseudo RxSwift implementation of a repository pattern that supports offline and remote operations. I'm trying to migrate it from using our homegrown implementation of Dynamic to using promises from the PromiseKit library; the code I'm…
Tristian
  • 3,406
  • 6
  • 29
  • 47
0
votes
0 answers

Promise is getting fulfilled even before my asynchronous operation is completed in swift PromiseKit

Blockquote I am trying to load the details from Firebase in table view controller. Following is the service invocation and the promise is getting fulfilled even before the observation of all events are completed. import Firebase import…
Ajay
  • 41
  • 1
  • 7
0
votes
0 answers

Append generic struct to an array

I have an array of a generic Struct, the generic type of the struct extends of the class ResponseBase. In the function I try to append to the responseMapping array but no luck there, it always has the following error: Error: Cannot convert value of…
Mika
  • 35
  • 1
  • 4
0
votes
1 answer

Promises + Alamofire make sure network calls always on background

Does promises always run on background thread. @IBAction func doNetworkCall(_ sender: Any) { // Does this run on background thread Network.fetchPhotos().done { (photos) in } } static func fetchPhotos () ->…
AppleBee
  • 452
  • 3
  • 16