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.

Platforms
iOS 17+ · macOS 14+
Toolchain
Swift 6.0+
License
MIT
Dependencies
None

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.swiftSwift
.package(url: "https://github.com/KoenLee1023/KLCalendarLanes.git", from: "0.1.0")

Usage

Integration exampleSwift
let layout = KLCalendarLaneEngine().layout(
    events: events,
    in: week,
    configuration: .init(calendar: calendar, maximumLaneCount: 2)
)
let segments = layout.segments(startingOn: day)
KLCalendarLaneEngine

Calculates a KLCalendarLaneLayout for a visible half-open grid interval.

KLCalendarLaneConfiguration

Defines the Calendar, columns per row, lane capacity, and end-boundary semantics.

KLCalendarLaneLayout

Exposes 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.