From ef80db9e73c22888208b3c607784c364abc86175 Mon Sep 17 00:00:00 2001 From: vasavk Date: Tue, 30 Apr 2024 14:21:43 +0530 Subject: [PATCH] Digital ACT-191 ONEAPP-7016 story: minor changes --- VDS/Components/Calendar/Calendar.swift | 1 + VDS/Components/Calendar/CalendarIndicatorModel.swift | 4 ++-- VDS/Components/Calendar/CalendarLegendView.swift | 4 +++- VDS/Components/Calendar/CalendarReusableView.swift | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/VDS/Components/Calendar/Calendar.swift b/VDS/Components/Calendar/Calendar.swift index c9312c4e..a7ed560a 100644 --- a/VDS/Components/Calendar/Calendar.swift +++ b/VDS/Components/Calendar/Calendar.swift @@ -90,6 +90,7 @@ open class CalendarBase: View { collectionView.dataSource = self collectionView.showsHorizontalScrollIndicator = false collectionView.showsVerticalScrollIndicator = false + collectionView.backgroundColor = .clear collectionView.register(CalendarDateCollectionViewCell.self, forCellWithReuseIdentifier: CalendarDateCollectionViewCell.identifier) collectionView.register(CalendarHeaderReusableView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, diff --git a/VDS/Components/Calendar/CalendarIndicatorModel.swift b/VDS/Components/Calendar/CalendarIndicatorModel.swift index 911afe36..04ad9714 100644 --- a/VDS/Components/Calendar/CalendarIndicatorModel.swift +++ b/VDS/Components/Calendar/CalendarIndicatorModel.swift @@ -8,7 +8,7 @@ import Foundation /// Custom data type for indicators prop -//extension CalendarBase { +extension CalendarBase { public struct CalendarIndicatorModel { /// Text that shown to an indicator for legend @@ -22,4 +22,4 @@ import Foundation self.date = date } } -//} +} diff --git a/VDS/Components/Calendar/CalendarLegendView.swift b/VDS/Components/Calendar/CalendarLegendView.swift index df1bbdf6..78826ffd 100644 --- a/VDS/Components/Calendar/CalendarLegendView.swift +++ b/VDS/Components/Calendar/CalendarLegendView.swift @@ -30,7 +30,7 @@ open class CalendarLegendView: View { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - open var items: [CalendarIndicatorModel] = [] { didSet { setNeedsUpdate() } } + open var items: [CalendarBase.CalendarIndicatorModel] = [] { didSet { setNeedsUpdate() } } //-------------------------------------------------- // MARK: - Private Properties @@ -90,6 +90,8 @@ open class CalendarLegendView: View { open override func updateView() { super.updateView() legendCollectionView.reloadData() + setNeedsLayout() + layoutIfNeeded() } override open func layoutSubviews() { diff --git a/VDS/Components/Calendar/CalendarReusableView.swift b/VDS/Components/Calendar/CalendarReusableView.swift index 8131ce33..96995006 100644 --- a/VDS/Components/Calendar/CalendarReusableView.swift +++ b/VDS/Components/Calendar/CalendarReusableView.swift @@ -47,7 +47,7 @@ class CalendarFooterReusableView: UICollectionReusableView { fatalError("init(coder:) has not been implemented") } - func configure(with indicators: [CalendarIndicatorModel]) { + func configure(with indicators: [CalendarBase.CalendarIndicatorModel]) { footerView.items = indicators addSubview(footerView) }