Skip to content

Commit

Permalink
Updated filters' processor signature #5
Browse files Browse the repository at this point in the history
  • Loading branch information
mozharovsky committed Nov 29, 2016
1 parent 3f1edcf commit a24558a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ extension FilterViewController: UICollectionViewDataSource, UICollectionViewDele
}
}

func prepareImage(at indexPath: IndexPath, completion: (UIImage?) -> Void) {
func prepareImage(at indexPath: IndexPath, completion: @escaping (UIImage?) -> Void) {
switch indexPath.item {
case 0:
names[indexPath] = "None"
Expand Down
6 changes: 1 addition & 5 deletions Source/ImageProcessor/Processor/ImageProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public struct ImageProcessor: ImageProcessorType {

// MARK: ImageProcessorType properties

public func process<T : Filter>(image: UIImage, filter: T, completion: (UIImage?) -> Void) {
public func process<T : Filter>(image: UIImage, filter: T, completion: @escaping (UIImage?) -> Void) {
print("[ImageProcessor]: Unable to find appropriate processing method's overload...")
}

Expand Down Expand Up @@ -237,10 +237,6 @@ public struct ImageProcessor: ImageProcessorType {
fileprivate func setValues<T : Filter>(for filter: CIFilter, with _filter: T) {
let scanned = _filter.scanned()
for (key, value) in scanned {
guard let value = value as? AnyObject else {
continue
}

filter.setValue(value, forKey: key)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ImageProcessor/Processor/ImageProcessorType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import UIKit

public protocol ImageProcessorType {
func process<T : Filter>(image: UIImage, filter: T, completion: (UIImage?) -> Void)
func process<T : Filter>(image: UIImage, filter: T, completion: @escaping (UIImage?) -> Void)
}

0 comments on commit a24558a

Please sign in to comment.