Files
Attractor/App/Utilities/UIView+Utils.swift

30 lines
501 B
Swift
Raw Permalink Normal View History

//
// UIView+Utils.swift
// App
//
// Created by James Magahern on 8/5/22.
//
import UIKit
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
}
protocol Conf { }
extension Conf {
@discardableResult
func conf(_ block: (Self) -> Void) -> Self {
block(self)
return self
}
}
extension UIView: Conf {}