I hereby claim:
- I am atetlaw on github.
- I am atetlaw (https://keybase.io/atetlaw) on keybase.
- I have a public key whose fingerprint is C884 BC45 DD40 2CA6 17EA 9D07 081C 08B6 B5DD 33FC
To claim this, I am signing this object:
import Combine | |
extension Publisher { | |
func mapVoid() -> MapVoid<Self> { | |
MapVoid(upstream: self) | |
} | |
} | |
struct MapVoid<P: Publisher>: Publisher { | |
typealias Output = Void |
// | |
// CardSheet.swift | |
// | |
// Created by Andrew Tetlaw on 4/12/21. | |
// | |
import SwiftUI | |
struct CardSheet<SheetContent: View>: ViewModifier { | |
@Binding var show: Bool |
// From https://stackoverflow.com/questions/34772439/see-characters-in-an-nscharacterset-swift | |
extension NSCharacterSet { | |
var characters: [String] { | |
var chars = [String]() | |
for plane:UInt8 in 0...16 { | |
if self.hasMemberInPlane(plane) { | |
let p0 = UInt32(plane) << 16 | |
let p1 = (UInt32(plane) + 1) << 16 | |
for c:UTF32Char in p0..<p1 { | |
if self.longCharacterIsMember(c) { |
extension CLLocationDegrees { | |
public var degrees: Measurement<UnitAngle> { | |
return Measurement(value: self, unit: .degrees) | |
} | |
public var radians: Measurement<UnitAngle> { | |
return degrees.converted(to: .radians) | |
} | |
public var degreesMinutes: (Measurement<UnitAngle>, Measurement<UnitAngle>) { |
public protocol ScopeNamed { | |
static func scope() -> String | |
} | |
/* Named represents the basic element, something that can output its name, but also has a parent scope */ | |
public protocol Named { | |
associatedtype ParentScope: ScopeNamed | |
} |
prefix operator ~% {} | |
prefix func ~%<E: RawRepresentable>(e: E) -> E.RawValue { | |
return e.rawValue | |
} |
extension SequenceType where Generator.Element == Category { | |
func joinNamesWithSeparator(separator: String) -> String { | |
return self.reduce("", combine: { ( combinedString: String, cat: Category) in | |
guard let name = cat.name else { | |
return combinedString | |
} | |
return combinedString + (combinedString.isEmpty ? name : "\(separator)\(name)") | |
}) | |
} | |
} |
public func AssertThrowsSpecific<E:ErrorType>(@autoclosure expression: () throws -> Void, expectedError: E, _ message: String = "", file: String = __FILE__, line: UInt = __LINE__) { | |
do { | |
try expression() | |
FailAssertion(__FUNCTION__, message, file, line) | |
} catch let caughtError { | |
guard caughtError is E else { | |
FailAssertion(__FUNCTION__, message, file, line) | |
return | |
} | |
} |
import UIKit | |
protocol SegueNaming: RawRepresentable { | |
static func handle<T : SegueNaming>(segue: UIStoryboardSegue, f: T -> Void) | |
init?(withSegue: UIStoryboardSegue) | |
var segueIdentifier: String { get } | |
} | |
extension SegueNaming where Self.RawValue == String { | |
static func handle<T:SegueNaming>(segue: UIStoryboardSegue, f: T -> Void) { |
I hereby claim:
To claim this, I am signing this object: