Skip to content

Instantly share code, notes, and snippets.

View timcolson's full-sized avatar

Tim Colson timcolson

View GitHub Profile
extension Result {
public func `catch`(_ handler: () throws -> Success) -> Result<Success, Error> {
flatMapError { _ in
.init { try handler() }
}
}
public func `catch`(_ handler: (Failure) throws -> Success) -> Result<Success, Error> {
flatMapError { error in
.init { try handler(error) }
@karlis
karlis / RotationGesture.swift
Created February 16, 2021 13:58
Work in progress. Example SwiftUI gesture. One finger rotation around center.
//
// Example.swift
// Vinyl
//
// Created by Karlis Lukstins on 16/02/2021.
//
import SwiftUI
// MARK: - Example