Skip to content

Instantly share code, notes, and snippets.

View sebastiangrail's full-sized avatar

Sebastian Grail sebastiangrail

  • Canva
  • Sydney, Australia
View GitHub Profile
@sebastiangrail
sebastiangrail / rac_serial_requests.swift
Last active May 8, 2016 23:59 — forked from tomj/rac_serial_requests.swift
Make 2 serial network requests with ReactiveCocoa in an Xcode Playground
import Result
import ReactiveCocoa
import Foundation
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
let producer1 = SignalProducer<AnyObject, NSError> { observer, disposable in
let task1 = NSURLSession.sharedSession().dataTaskWithURL(NSURL(string:"http://jsonplaceholder.typicode.com/posts/1")!, completionHandler: { (data, response, error) in
if error != nil {