Skip to content

Instantly share code, notes, and snippets.

@foxicode
Created February 5, 2023 17:46
Show Gist options
  • Select an option

  • Save foxicode/6ce467b63f040af9949f6e2b891202cc to your computer and use it in GitHub Desktop.

Select an option

Save foxicode/6ce467b63f040af9949f6e2b891202cc to your computer and use it in GitHub Desktop.
Add subview with constraints
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