Created
September 19, 2021 03:11
-
-
Save dymx101/b03991e31506c97303ed21a37499eaba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func createView<T>(_ setup: ((T) -> Void)) -> T where T: UIView { | |
let view = T() | |
view.translatesAutoresizingMaskIntoConstraints = false | |
setup(view) | |
return view | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment