Created
February 5, 2023 17:46
-
-
Save foxicode/6ce467b63f040af9949f6e2b891202cc to your computer and use it in GitHub Desktop.
Add subview with constraints
This file contains hidden or 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
| import SnapKit | |
| import UIKit | |
| extension UIView { | |
| func addSubview(_ view: UIView, closure: (ConstraintMaker) -> Void) { | |
| addSubview(view) | |
| view.snp.makeConstraints(closure) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment