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
1
vote
1 answer

PromiseKit 6: Cannot invoke 'then' with an argument list of type '((String, String) -> Promise)'

I have a when(fulfilled: [Thenable]) that returns Promise<(String, String)>, however when I try to use these arguments in my then block I receive the following error: Cannot invoke 'then' with an argument list of type '((String, String) ->…
Sawdust
  • 115
  • 2
  • 8
1
vote
1 answer

PromiseKit manual installation

I am new to programming. Therefore, installing PromiseKit has been difficult for me. Upon investigating the various installation methods, I attempted to install via Carthage (unsuccessfully it turned out because than I had to figure out how to…
Dom Ruiz
  • 11
  • 2
1
vote
2 answers

PromiseKit 6: How to create multiple concurrent promises and group their individual results into an array?

I'm dealing with a weird API where I receive a list of IDs, and I need to request data on each of those IDs individually. I don't need to chain these requests one after the other, I just want to grab them all at once, but I'm having trouble figuring…
ray
  • 1,966
  • 4
  • 24
  • 39
1
vote
1 answer

Why recursive PromiseKit functions cannot be compiled?

I have next recursive Promise function call: func getPlaces(location: Location) -> Promise<[Geosearch]> { return Promise().then { URLSession.shared.dataTask(.promise, with: url) }.compactMap { result in let json = try…
1
vote
1 answer

Cannot get data in handler for when(resolved:)

PromiseKit 6 I have a function that fetches a list of alerts from a db, I then need to use the contentId property on each to fetch the content and attach to the appropriate alert item. Maybe there's a better way, but for now, what I came up with is…
SamAko
  • 3,485
  • 7
  • 41
  • 77
1
vote
1 answer

PromiseKit AnyPromise then crash EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010

I have a crash in Fabric that points to the first line in Objective-C: somePromise.then(^ { // some more code }); The app is using PromiseKit. Why is this crashing?
Johannes Fahrenkrug
  • 42,912
  • 19
  • 126
  • 165
1
vote
1 answer

How To Use PromiseKit 6.3 To Return Promise

I'm having trouble converting from PromiseKit 4.0 to PromiseKit 6.3. I am trying to convert this particular function into the new version. How can I do this? func registerUser(_ email: String, givenName: String, familyName: String, password: String)…
1
vote
0 answers

How to use the when function in Promisekit loop

I have an array of appointments and I'm trying to grab all of the photos for these appointments from our windows azure blob storage. First, I want to get the list of blobs with the associated appointmentId so I can download and store them properly…
Energy CJ
  • 125
  • 2
  • 11
1
vote
1 answer

PromiseKit 6.0 migration

I have decided to upgrade PromiseKit pod form 4.5.x to 6.x.x in my project. During migration process I met an problem which I not 100% sure I solved it in proper way. Take a look on my sample code from PromiseKit 4.5: func…
Kamil Harasimowicz
  • 4,684
  • 5
  • 32
  • 58
1
vote
0 answers

Cannot access more than one value from function using PromiseKit Swift

TemplateClass.m + (AnyPromise *) promisefunctionReturnThreeValus:(NSString *)sampleName { return [self anotherPromiseFunction:sampleName].then(^(NSMutableDictionary *sampleDict) { DataArray *data = [DataArray dataArrayFromDict:sampleDict]; …
Ayyanar
  • 526
  • 1
  • 5
  • 10
1
vote
0 answers

changing the return value of PromiseKit's recover

I want to use CLGeocoder and always produce a CLLocation, whether the geocode call fails or not. Unfortunately, you can't get a value to always without capturing an outside variable, and putting recover directly after the geocode call requires that…
ray
  • 1,966
  • 4
  • 24
  • 39
1
vote
0 answers

PromiseKit to act as RxSwift on variable observing

I use RxSwift at work (ont a big fan, too complex, but really powerful indeed), and I want to try to use PromiseKit as a "smaller" tool. I try to create sort of an Observable with PromiseKit, but I can't figure it out. I tried to use the NSObject's…
Khal
  • 790
  • 5
  • 23
1
vote
2 answers

PromiseKit go back one step

I have a series of UIViewControllers (popups) in my app that I use to gather information from the end user. I managed to chain them with promises like this: firstly { return showFirstPopup() } .then { info1 -> Promise in …
Diana
  • 21
  • 6
1
vote
1 answer

capture Progress from when

My Promise usage looks like - when(fulfilled: [promise]).then {(response) -> Void in }.catch { (error) in print(error) } I'm trying to figure out how i can utilize progress property from when.swift but no luck so far. Thanks in advance.
Avi
  • 2,196
  • 18
  • 18
1
vote
2 answers

PromiseKit firstlyOn style method

PromiseKit provides a convenience method thenOn for running parts of your chain on non-main threads. However there doesn't appear to be any convenient way of setting the first promise execution thread. This means that I end up either placing a…
TRG
  • 845
  • 1
  • 9
  • 22