23 lines
444 B
Swift
23 lines
444 B
Swift
|
//
|
||
|
// UIView+Configure.swift
|
||
|
// Tusker
|
||
|
//
|
||
|
// Created by Shadowfacts on 10/2/22.
|
||
|
// Copyright © 2022 Shadowfacts. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import UIKit
|
||
|
|
||
|
protocol Configurable {
|
||
|
associatedtype T = Self
|
||
|
func configure(_ closure: (T) -> Void) -> T
|
||
|
}
|
||
|
extension Configurable where Self: UIView {
|
||
|
func configure(_ closure: (Self) -> Void) -> Self {
|
||
|
closure(self)
|
||
|
return self
|
||
|
}
|
||
|
}
|
||
|
extension UIView: Configurable {
|
||
|
}
|