From 3d303e6c0788611ba7a9cd34516b745b37fb1451 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 15 Feb 2024 10:54:42 -0600 Subject: [PATCH 1/3] allow overriding Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 113d19f5..ddb5d617 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -198,7 +198,7 @@ extension ButtonGroup: UICollectionViewDataSource, UICollectionViewDelegate { return buttons.count } - public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let button = buttons[indexPath.row] guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) as? ButtonGroupCollectionViewCell else { return UICollectionViewCell() } cell.contentView.subviews.forEach { $0.removeFromSuperview() } From abb94257da8d8045e1d88f92e10c4195dd43fac1 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Mon, 26 Feb 2024 13:28:24 +0530 Subject: [PATCH 2/3] fixed conflicting constraints --- VDS/Components/Notification/Notification.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 2ed84116..126f83f0 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -398,13 +398,18 @@ open class Notification: View { } private func setConstraints() { + maxWidthConstraint?.deactivate() + labelViewAndButtonViewConstraint?.deactivate() + labelViewBottomConstraint?.deactivate() + buttonGroupCenterYConstraint?.deactivate() + buttonGroupBottomConstraint?.deactivate() maxWidthConstraint?.constant = maxViewWidth maxWidthConstraint?.isActive = UIDevice.isIPad labelViewAndButtonViewConstraint?.isActive = layout == .vertical && !buttonGroup.buttons.isEmpty - typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width - closeIconWidthConstraint?.constant = closeButton.size.dimensions.width labelViewBottomConstraint?.isActive = layout == .horizontal || buttonGroup.buttons.isEmpty buttonGroupCenterYConstraint?.isActive = layout == .horizontal buttonGroupBottomConstraint?.isActive = layout == .vertical + typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width + closeIconWidthConstraint?.constant = closeButton.size.dimensions.width } } From 11c8ed87565c85e2c4979ff5962c6e461b902d62 Mon Sep 17 00:00:00 2001 From: "Bandaru, Krishna Kishore" Date: Mon, 26 Feb 2024 21:10:53 +0000 Subject: [PATCH 3/3] Fixed conflicting constraints while displaying Notifications --- VDS/Components/Notification/Notification.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 2ed84116..126f83f0 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -398,13 +398,18 @@ open class Notification: View { } private func setConstraints() { + maxWidthConstraint?.deactivate() + labelViewAndButtonViewConstraint?.deactivate() + labelViewBottomConstraint?.deactivate() + buttonGroupCenterYConstraint?.deactivate() + buttonGroupBottomConstraint?.deactivate() maxWidthConstraint?.constant = maxViewWidth maxWidthConstraint?.isActive = UIDevice.isIPad labelViewAndButtonViewConstraint?.isActive = layout == .vertical && !buttonGroup.buttons.isEmpty - typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width - closeIconWidthConstraint?.constant = closeButton.size.dimensions.width labelViewBottomConstraint?.isActive = layout == .horizontal || buttonGroup.buttons.isEmpty buttonGroupCenterYConstraint?.isActive = layout == .horizontal buttonGroupBottomConstraint?.isActive = layout == .vertical + typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width + closeIconWidthConstraint?.constant = closeButton.size.dimensions.width } }