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

Video file is not ready when it's time to play it

New in ios, using Swift 2.0, I have video file in Amazon S3, I use HanekeSwift for download and "cache" that video file and then play it, the issue is that when I play the video, the file written by hakene it isn't yet available, so nothing plays…
user2976753
  • 935
  • 11
  • 24
1
vote
0 answers

Can't Inhibit deprecation warnings in PromiseKit added throu CocoaPods

I'm tring to use PromiseKit throu CocoaPods in my project. Minimum deployment target in projsect is setted to 9.0. Problem I'm getting deprecation warnings in PromiseKit which I'm trying to rid of. Warnings appear in in…
Błażej
  • 3,617
  • 7
  • 35
  • 62
1
vote
1 answer

Swift 2 Promisekit 3 chaining asyc methods madness

I have 3 promises, each works individually: DataManager.reverseGeoCodePromise("42.527328", longitude: "-83.146928").then { data in print("Zip \(data)") } DataManager.getEnviroUVWithZipPromise("48073").then { data in print("UV…
Jim Peters
  • 31
  • 4
1
vote
2 answers

Chaining promises in PromiseKit 3.0 And Swift 2

How am I supposed to chain promises in PromiseKit 3.0 And Swift 2? I'm trying the following code: let url = "https://httpbin/org/get"; let url2 = "https://httpbin/org/get"; firstly { NSURLSession.GET(url) }.then { (json: NSDictionary) in …
Eduardo Cobuci
  • 5,621
  • 4
  • 25
  • 27
1
vote
1 answer

Join failing in PromiseKit 3.0

I have an array of promises and I need to resolve them all and take a list of the ones that succeeded. As I understand it, I need to use join to do that. However, when I write: let promises: [Promise] = /* ... */ let foo = join(promises) I…
Daniel T.
  • 32,821
  • 6
  • 50
  • 72
1
vote
2 answers

PromiseKit Syntax Chain swift

I'm trying to chain some promise on promise kit, I have syntax problem when the promise type is like this Promise, only when the promise has a type I get compiler error. I'm new on using promisekit Swift.start(host,"","").then{ result ->…
Cesar Oyarzun
  • 169
  • 2
  • 8
1
vote
0 answers

Waiting for "finally" clause in PromiseKit to finish

Currently I am using PromiseKit to chain a logic, which is like the following: [NSURLConnection promise:rq1].then(^(id data1) { return [NSURLConnection promise:rq2]; }).then(^(id data2) { return [NSURLConnection promise:rq3]; }).then(^(id…
o15a3d4l11s2
  • 3,969
  • 3
  • 29
  • 40
1
vote
2 answers

Chaining promises on PromiseKit

I'm trying to chain a number of promises that need to be resolved before returning. In my case, for each element of databaseResult I need to fetch some data with a method that returns a promise. Once I've fetched the data for every single element of…
Jack
  • 171
  • 2
  • 16
1
vote
1 answer

PromiseKit doesn't compile with Swift 2 and Xcode 7

This is the error I am seeing when I try to build my project after installing PromiseKit. Cannot import module being compiled. This is what my PodFile contains to install PromiseKit. pod 'PromiseKit', :git =>…
user462455
  • 12,838
  • 18
  • 65
  • 96
1
vote
1 answer

Using same then/catch/finally blocks for two promises of different types

I have the following operations: class CreateObjectOperation { // ... func promise() -> Promise } class DeleteObjectOperation { // ... func promise() -> Promise } I want to be able to use the same then/catch/finally…
Andrii Chernenko
  • 9,873
  • 7
  • 71
  • 89
1
vote
2 answers

Own Promisekit promises do not response properly

I wrote my own promise and want to chain it, but the result is always only the first in the chain. I think there is an understanding issue on my side how to use them, but I don't able to find it. My…
1
vote
1 answer

Unit testing code with PromiseKit usage

I'm trying to test Diary class that has dependency to Network. So Diary code: - (PMKPromise *)saveAndUploadToServer:(DiaryItem *)item { return [self save:item].then(^{ return [self upload:item]; << See UPDATE //I put breakpoint here, it…
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114
0
votes
0 answers

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 getRemoteItem is called, all the remaining calls…
KvnH
  • 496
  • 1
  • 9
  • 30
0
votes
0 answers

Network call in Swift and PromiseKit

I have two functions that should make a request to the network. The first function should add the command "enable" and the second "disable". But it doesn't work. I think I sent the wrong call, could you help me to fix it? The second function is the…
NexusUA
  • 217
  • 1
  • 3
  • 13
0
votes
0 answers

PromiseKit to ReactiveSwift migration: pending method in mock class

I want to know the equivalent part in ReactiveSwift for this PromiseKit code snippet import PromiseKit // import ReactiveSwift class MockA { .... public var addressReturnValue: Promise? public func createAddress() ->…
aguilarpgc
  • 1,181
  • 12
  • 24