From ff0117dc1da8fc0d4818a8f593a952c75e9aab57 Mon Sep 17 00:00:00 2001 From: vasavk Date: Thu, 16 May 2024 16:55:00 +0530 Subject: [PATCH] Hide legend view when date indicators are empty --- VDS/Components/Calendar/Calendar.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Calendar/Calendar.swift b/VDS/Components/Calendar/Calendar.swift index f7c1940c..fd3e3452 100644 --- a/VDS/Components/Calendar/Calendar.swift +++ b/VDS/Components/Calendar/Calendar.swift @@ -67,7 +67,7 @@ open class CalendarBase: Control, Changeable { //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- - internal var containerSize: CGSize { CGSize(width: 328, height: 376) } + internal var containerSize: CGSize { CGSize(width: 328, height: 336) } internal var calendar = Calendar.current private let cellItemSize = CGSize(width: 40, height: 40) @@ -358,7 +358,7 @@ extension CalendarBase: UICollectionViewDelegate, UICollectionViewDataSource, UI } public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize { - return CGSize(width: collectionView.frame.size.width, height: footerHeight) + return CGSize(width: collectionView.frame.size.width, height: indicators.count > 0 ? footerHeight : 0) } public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {