Skip to content

Instantly share code, notes, and snippets.

@paskowski
Created February 19, 2018 13:03
Show Gist options
  • Save paskowski/34b016b5630c6ed851fe5bf11bbea071 to your computer and use it in GitHub Desktop.
Save paskowski/34b016b5630c6ed851fe5bf11bbea071 to your computer and use it in GitHub Desktop.
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
let image = UIImage(named: "image-1.jpg")
let monoImageOperation = MonoImageOperation(inputImage: image!)
monoImageOperation.completionBlock = {
DispatchQueue.main.async {
self.imageView.image = monoImageOperation.outputImage
}
}
let operationQueue = OperationQueue()
operationQueue.addOperation(monoImageOperation)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment