From a094326ffbc1cb3c19eac38a3dafd97405fe75fb Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 22 Apr 2020 21:17:57 -0400 Subject: [PATCH] use convenience function --- .../ContainerCollectionReusableView.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ContainerCollectionReusableView.swift b/MVMCoreUI/BaseControllers/ContainerCollectionReusableView.swift index d7fb0ed4..c59fd097 100644 --- a/MVMCoreUI/BaseControllers/ContainerCollectionReusableView.swift +++ b/MVMCoreUI/BaseControllers/ContainerCollectionReusableView.swift @@ -20,11 +20,8 @@ public class ContainerCollectionReusableView: UICollectionReusableView { view.setContentCompressionResistancePriority(.required, for: .vertical) addSubview(view) self.view = view - topConstraint = view.topAnchor.constraint(equalTo: topAnchor) - topConstraint?.isActive = true - bottomConstraint = bottomAnchor.constraint(equalTo: view.bottomAnchor) - bottomConstraint?.isActive = true - rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true - view.leftAnchor.constraint(equalTo: leftAnchor).isActive = true + let constraints = NSLayoutConstraint.constraintPinSubview(toSuperview: view) + topConstraint = constraints?[ConstraintTop] as? NSLayoutConstraint + bottomConstraint = constraints?[ConstraintBot] as? NSLayoutConstraint } }