Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created February 23, 2018 18:59
Show Gist options
  • Save IsaAliev/d5448ceea02a39ad70baa4c0b3e48bc6 to your computer and use it in GitHub Desktop.
Save IsaAliev/d5448ceea02a39ad70baa4c0b3e48bc6 to your computer and use it in GitHub Desktop.
import Foundation
typealias JSON = [String: Any]
enum Result<T> {
case Value(T)
case Error(ErrorRepresentable)
case None
}
protocol ResponseHandler {
associatedtype ResultValueType
func handleResponse(_ response: ResponseRepresentable, completion: (Result<ResultValueType>) -> ())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment