From 323fb7fc82b45a096b4a46f10995369873b4df5d Mon Sep 17 00:00:00 2001 From: Bryan Keller Date: Thu, 15 Aug 2024 11:41:55 -0400 Subject: [PATCH 1/3] Add visibleMonthRange and visibleDayRange to proxy --- CHANGELOG.md | 1 + Sources/Public/CalendarViewProxy.swift | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7d46e..41d4eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for disabling touch handling on SwiftUI views via the `allowsHitTesting` modifier - Added SwiftUI documentation to the README.md +- Added properties to `CalendarViewProxy` for getting the `visibleMonthRange` and `visibleDayRange` ### Fixed - Fixed an issue that could cause accessibility focus to shift unexpectedly diff --git a/Sources/Public/CalendarViewProxy.swift b/Sources/Public/CalendarViewProxy.swift index f30f8fb..b731bc4 100644 --- a/Sources/Public/CalendarViewProxy.swift +++ b/Sources/Public/CalendarViewProxy.swift @@ -26,6 +26,16 @@ public final class CalendarViewProxy: ObservableObject { // MARK: Public + /// The range of months that are partially of fully visible. + public var visibleMonthRange: MonthComponentsRange? { + calendarView.visibleMonthRange + } + + /// The range of months that are partially of fully visible. + public var visibleDayRange: DayComponentsRange? { + calendarView.visibleDayRange + } + /// Scrolls the calendar to the specified month with the specified position. /// /// If the calendar has a non-zero frame, this function will scroll to the specified month immediately. Otherwise the scroll-to-month From 12345ca7d74f1b41fa64548920e749bac70b8e36 Mon Sep 17 00:00:00 2001 From: Bryan Keller Date: Thu, 15 Aug 2024 16:29:33 -0400 Subject: [PATCH 2/3] Update Sources/Public/CalendarViewProxy.swift Co-authored-by: Bryn Bodayle --- Sources/Public/CalendarViewProxy.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Public/CalendarViewProxy.swift b/Sources/Public/CalendarViewProxy.swift index b731bc4..e3ca13e 100644 --- a/Sources/Public/CalendarViewProxy.swift +++ b/Sources/Public/CalendarViewProxy.swift @@ -31,7 +31,7 @@ public final class CalendarViewProxy: ObservableObject { calendarView.visibleMonthRange } - /// The range of months that are partially of fully visible. + /// The range of months that are partially or fully visible. public var visibleDayRange: DayComponentsRange? { calendarView.visibleDayRange } From 0d3911a926756f56e14723438dc45c7d2cf67e86 Mon Sep 17 00:00:00 2001 From: Bryan Keller Date: Thu, 15 Aug 2024 16:29:41 -0400 Subject: [PATCH 3/3] Update Sources/Public/CalendarViewProxy.swift Co-authored-by: Bryn Bodayle --- Sources/Public/CalendarViewProxy.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Public/CalendarViewProxy.swift b/Sources/Public/CalendarViewProxy.swift index e3ca13e..0831c6b 100644 --- a/Sources/Public/CalendarViewProxy.swift +++ b/Sources/Public/CalendarViewProxy.swift @@ -26,7 +26,7 @@ public final class CalendarViewProxy: ObservableObject { // MARK: Public - /// The range of months that are partially of fully visible. + /// The range of months that are partially or fully visible. public var visibleMonthRange: MonthComponentsRange? { calendarView.visibleMonthRange }