Skip to content
Snippets Groups Projects
Commit 10bcecda authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add ViewConfigurator

parent ddc0ffab
No related branches found
No related tags found
2 merge requests!54Releasing 1.1.4,!51CollectionView library
import UIKit
public struct ViewConfigurator<View: UIView, Model> {
public init(configure: @escaping (View, Model) -> Void) {
self.configure = configure
}
public var configure: (View, Model) -> Void
public func callAsFunction(view: View, with model: Model) {
configure(view, model)
}
}
#if DEBUG
extension ViewConfigurator {
public static func failing() -> ViewConfigurator {
ViewConfigurator { _, _ in fatalError("Not implemented") }
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment