This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Uploader { | |
[...] | |
private func uploadImages() -> Future<Void, UploadError> { | |
let promise = Promise<Void, UploadError>() | |
var imageSequence: [Future<Void, UploadError>]! = [] // 1 | |
let queue = OperationQueue() // 2 | |
queue.maxConcurrentOperationCount = 3 | |
for case let image as Image in self.images { | |
let promise = Promise<Void, UploadError>() // 3 | |
let operation = UploadOperation(image: image, promise: promise) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AsynchronousOperation.swift | |
// | |
// Created by Robert Ryan on 9/20/14. | |
// Copyright (c) 2014 Robert Ryan. All rights reserved. | |
// | |
import UIKit | |
import Alamofire | |
import BrightFutures |