Ilya Belenkiy

4 posts

Chaining an array of promises

Typically, when we have multiple unrelated asynchronous tasks, we want to execute them concurrently and possibly combine the results when all tasks are completed. Occasionally, though, concurrent execution is not possible, and we need to execute each task only after the previous is completed. One example of this is calling an API that accepts only one connection (we ran into this when trying to upload multiple attachments via Zendesk SDK). The API that we want then is exactly the same as with co

PromiseKit and `ensure`

Update: PromiseKit added ensureThen (discussion [https://github.com/mxcl/PromiseKit/pull/841]). Intro The essence of functional programming is to express computation in small, self contained units (functions) that we can combine together to get the result. If each unit that we start with doesn't affect other units, we can combine them in all kinds of ways and still easily reason about the outcome. For example, if we have func f(x: T) -> V {...} func g(x: V) -> U {...} We can do g(f(x)) to co

Logging errors in Swift

Error reporting and handling is tricky. In C, it's done by returning and examining error codes, which is very error prone since it's easy to forget to check for the error and it's often difficult to decipher what the error code means. Modern languages use exceptions, and some form of try / catch to move control from the place where an error occurs to where the code can deal with it. This is much more convenient, but in many cases there are errors that don't need any special handling. What matter

Developer / Designer Workflow

Developer / Designer Workflow

(You can find the Xcode project and the Sketch file for this post here [https://github.com/rocketinsights/blog-samples/tree/master/Components].) There are two approaches to building user interfaces: using a visual tool or doing everything in code. Each has its own advantages and disadvantages. Let's see what they are and find a way to combine the best of both when designing and building an iOS app. Visual Tools vs Coding The biggest advantage of a visual tool is that if you know the tool well,

Could not sign up! Invalid sign up link.