Swift package · v0.1.0
KLCalendarLanes
Allocate deterministic lanes for multi-day all-day event bars.
A UI-independent layout engine for clipped calendar-grid ranges. It normalizes dates with the supplied Calendar, splits bars at row boundaries, and reports deterministic overflow and daily lane coverage.
Functions
- Calendar-aware multi-day range normalization
- Row-local segments with boundary flags
- Deterministic lane allocation and overflow
- Day-based lane coverage queries for host spacing
Not included
It allocates range-bar geometry only. Event titles, colors, single-day rows, views, and host event models remain outside the package.
Install with SwiftPM
.package(url: "https://github.com/KoenLee1023/KLCalendarLanes.git", from: "0.1.0")Usage
let layout = KLCalendarLaneEngine().layout(
events: events,
in: week,
configuration: .init(calendar: calendar, maximumLaneCount: 2)
)
let segments = layout.segments(startingOn: day)API documentation
Open the complete API documentation.KLCalendarLaneEngineCalculates a KLCalendarLaneLayout for a visible half-open grid interval.
KLCalendarLaneConfigurationDefines the Calendar, columns per row, lane capacity, and end-boundary semantics.
KLCalendarLaneLayoutExposes row-local segments, deterministic overflow IDs, and day-based coverage queries.
Demo apps
MonthLane
Renders a compact month grid with multi-day bars and host-owned same-day rows.
LaneStressLab
Changes row width, lane capacity, first weekday, and event count while showing overflow.