Skip to content

Instantly share code, notes, and snippets.

View Oyvindkg's full-sized avatar

Øyvind Grimnes Oyvindkg

View GitHub Profile
@Oyvindkg
Oyvindkg / Result.swift
Last active February 6, 2017 10:21
Swift 3: An enum used for error handling in asynchronous calls
/**
Represents the result of an asynchronous call.
Can be either a successfull result containing a return value, or a failure containing an error.
*/
public enum Result<Value> {
case failure(error: Error)
case success(value: Value)