simulator runtime is not available.
Unable to open liblaunch_sim.dylib Try reinstalling Xcode or the simulator runtime.
Solution:
// Based on https://gist.github.com/ColinEberhardt/05fafaca143ac78dbe09 | |
// Make handler as closure type | |
protocol Disposable { | |
func dispose() | |
} | |
class Event<T> { | |
typealias Handler = (data: T) -> Void | |
private var handlers = [HandlerWrapper<T>]() |
// : Alternative to try? from Erica Sadun - http://ericasadun.com/2015/09/03/alternatives-to-try-swiftlang/ | |
enum Result<T> { | |
case Value(T) | |
case Error(ErrorType) | |
init(_ block: () throws -> T) { | |
do { | |
let value = try block() | |
self = Result.Value(value) |