2022-08-05 15:13:37 -07:00
|
|
|
//
|
|
|
|
|
// UIView+Utils.swift
|
|
|
|
|
// App
|
|
|
|
|
//
|
|
|
|
|
// Created by James Magahern on 8/5/22.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
2023-01-25 15:04:58 -08:00
|
|
|
infix operator .. : AssignmentPrecedence
|
|
|
|
|
|
|
|
|
|
@discardableResult @inline(__always) @inlinable
|
|
|
|
|
public func .. <T: Any>(it: T, apply: (inout T) throws -> Void) rethrows -> T {
|
|
|
|
|
var it = it
|
|
|
|
|
try apply(&it)
|
|
|
|
|
return it
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-05 15:13:37 -07:00
|
|
|
protocol Conf { }
|
|
|
|
|
|
|
|
|
|
extension Conf {
|
|
|
|
|
@discardableResult
|
|
|
|
|
func conf(_ block: (Self) -> Void) -> Self {
|
|
|
|
|
block(self)
|
|
|
|
|
return self
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension UIView: Conf {}
|