NepaliCalendarViewController

fun NepaliCalendarViewController(initialSelectedDate: SimpleDate?, locale: NepaliDateLocale, yearRangeStart: Int, yearRangeEnd: Int, options: NepaliCalendarViewOptions?, events: NepaliEventOptions?, onHeightChange: (Float) -> Unit, onDaySelected: (CustomCalendar, NepaliDayStatus) -> Unit, onEventTapped: (NepaliCalendarEvent) -> Unit): UIViewController(source)

Hosts the browsable NepaliCalendar for a Swift caller: a month grid that fills its frame, pages month by month and marks the days events names.

Composable functions cannot be called from Swift, so this factory is the iOS entry point to the calendar. Wrap the returned controller in a UIViewControllerRepresentable to embed it in SwiftUI, and size the frame from onHeightChange.

The grid draws at a fixed height whatever the month's shape. Asking for the day's summary or the month's events stacks them under the grid inside this one controller, since two controllers cannot share a selection, which is why the height is reported rather than assumed.

Parameters

initialSelectedDate

the day picked when the calendar first appears, or null for none.

locale

language, date format and digit script the calendar renders with.

yearRangeStart

first Bikram Sambat year the calendar pages over.

yearRangeEnd

last Bikram Sambat year the calendar pages over.

options

appearance and behaviour knobs, or null for the library defaults.

events

the institution's weekly rule and the days it names, or null for Nepal's usual office week with nothing named.

onHeightChange

receives the content height in points, so the caller can size its frame.

onDaySelected

invoked with the tapped day and what the policy says about it: whether the day is a weekly off, whether the institution is shut, and everything named on it.

onEventTapped

invoked with the event behind a tapped line of the stacked month list, which is never called while NepaliCalendarViewOptions.showMonthEvents is off.