Understand HorizonCalendar Architecture
masterHorizonCalendar uses a custom layout solution designed for high performance and constant memory usage, regardless of the date range being displayed. Unlike UICollectionView, which scales memory usage linearly with the number of items, HorizonCalendar's memory footprint is dependent only on the number of items currently visible in the viewport.
Key architectural components include:
CalendarView: TheUIViewsubclass that acts as the central coordinator.VisibleItemsProvider: Determines which subset of calendar items is currently visible by checking adjacent items against the current viewport.LayoutItemTypeEnumerator: Used by the provider to traverse adjacent layout items.FrameProvider: Calculates item frames incrementally. It determines the position of an item (like aMonthor a day) based on the frame of a known adjacent item, allowing for lazy layout at arbitrary date offsets.ItemViewReuseManager: Manages the creation and reuse of views, similar toUICollectionView's reuse mechanism, by calculating the difference between the current and previous sets of visible items.