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
2 answers

PromiseKit 3.0: chaining with loops

I'm using promisekit 3.0 to help chain alamofire callbacks in a clean way. The objective is to start with a network call, with a promise to return an array of urls. Then, I'm looking to execute network calls on as many of those urls as needed to…
stanley
  • 1,113
  • 1
  • 12
  • 26
0
votes
1 answer

Can't specify the type of parameter to "then" handler

If I specifiy the type of my parameter of a then handler as so... .then { (things: [Thing]) -> Void in then I get the error... Cannot convert value of type '[Thing] -> Void' to expected argument type '(AnyObject) -> AnyPromise' Is it possible…
Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
0
votes
1 answer

Chaining of promises in PromiseKit

I have the following scenario: Request a token from the server Execute a request, i.e. getAllNews Parse the response of the request getAllNews Persist the parsed data Delete the requested token and I do these 5 operations using promises: return…
o15a3d4l11s2
  • 3,969
  • 3
  • 29
  • 40
0
votes
1 answer

save promise fulfill and reject promisekit

Hi I'm trying to create a promise and then save the function fulfill and reject into in array or dictionary . I don't know if this is possible to do I get some compiler erros. I know you can store functions inside array but I think since is inside…
Cesar Oyarzun
  • 169
  • 2
  • 8
0
votes
1 answer

Reloading tableview in Promisekit's then

I am trying to make async. request using Promisekit's promises. I have the following code in a subclass of UITableViewController, to reload tableview with data that is fetched from async. request. my_promise.then { asynly_fetched_data in …
user462455
  • 12,838
  • 18
  • 65
  • 96
0
votes
1 answer

PromiseKit 2.0: chaining promises doesn't pass argument

I have wrapped 2 of my API requests with Promise return types: func registerWithEmail(email: String, firstName: String, lastName: String, password: String, subscribe: Bool) -> Promise func requestAccessTokenWithEmail(username: String,…
Senior
  • 2,259
  • 1
  • 20
  • 31
0
votes
1 answer

OCMock stub blocks

I try to stub this AFNetworking method and test error case: - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success failure:(void (^)(AFHTTPRequestOperation *operation,…
tailec
  • 630
  • 1
  • 7
  • 20
0
votes
0 answers

Pointer to block pointer

I have a method using promises (PMKPromise), that I'd like to unit test using the library Kiwi. My method looks like this: - (void)fetchData { [PMKPromise new:^(PMKPromiseFulfiller fulfill, PMKPromiseRejecter reject) { // make the…
0
votes
1 answer

AFNetworking/ Overcoat/Promisekit - getting the return json in the error message

I am using AFNetworking, Overcoat and Promisekit. I would like to see the json that I am getting back from the server. //apiclient.h @interface STRAPIClient : OVCHTTPSessionManager //apiclient.m [self POST:@"contents" parameters:parameters] …
meow
  • 27,476
  • 33
  • 116
  • 177
0
votes
1 answer

Redefine extern block (promiseKit)

I am using PromiseKit (awesome framework, btw!) to handle communication between my app and a server API. I would like to create some kind of global handler to respond to things like notifying the user about a lack of network connection across any of…
Sean Fraser
  • 342
  • 3
  • 14
0
votes
1 answer

Promise kit segfault on init

When I run my code in the simulator in debug everything seems to work fine. When I run it without the debug, I get a segfault on initialization of a promise object. func URLGET( url: String ) -> Promise { return…
Lee Jacobs
  • 1,692
  • 3
  • 12
  • 21
-1
votes
1 answer

How to return value from Promise in swift

I have a function like this func fetchPokemons() -> [Pokemon] { var pokemons : [Pokemon] = [] service.fetchPokemons().done{ (newPokemons) in pokemons += newPokemons.pokemons! print(pokemons) }.catch { (error) in …
Ivanius
  • 109
  • 1
  • 2
  • 9
-1
votes
1 answer

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.ResponseSerializationFailureReason.decodingFailed(error:…
O_S
  • 24
  • 6
-1
votes
1 answer

Swift & PromiseKit, modifying object inside zip body does not mutate final array

so I have a fairly complicated scenario in my hands, it goes something like this: Fetch array of "Repository" entities Parse the repository array For each repository entity, the branches need to be fetched Once branches have been fetched, modify…
Oscar Franco
  • 5,691
  • 5
  • 34
  • 56
-1
votes
3 answers

How do I reverse a promise?

I'm using PromiseKit to handle flow through a process. Prior, I did a similar app without promises but decided frick it I'm gonna try promises just because, well, why not? So I'm throwing a back button in the mix as I did in the prior app. Only…
insta catering
  • 151
  • 2
  • 12
1 2 3
16
17