BookLens is an open-source SwiftUI appointment booking app for iOS and macOS — a full-source, production-quality example of a service-business scheduler, universal across iPhone, iPad, and Mac, built from real, reusable components instead of throwaway demo code. It's a companion example to AICompleteChat and BudgetLens, applying the same DesignFoundation / DesignFoundation Pro design system and on-device Apple Intelligence stack to a scheduling use case.
Every screen in the booking flow — service selection, time-slot scheduling, confirmation, and
"My Bookings" — comes from DesignFoundation Pro's Booking UI kit,
wired to real SwiftData persistence. On iOS, confirming a booking offers to add it straight to the
user's Calendar via EventKitUI — Apple's
zero-permission, zero-prompt way to add a single event — and the "AI Assistant" tab uses
on-device Foundation Models to explain, in plain
language, why a particular open slot is being suggested, on both platforms.
Looking for a real-world SwiftUI booking app template,
a working EventKit calendar integration example,
or a buildable reference for LanguageModelSession and @Generable structured output
on iOS 26? This is a full app, not a snippet.
- DesignFoundation — the free, open-source SwiftUI design system behind every button, text field, list row, calendar, and theme in this app.
- DesignFoundation Pro — the premium SwiftUI booking UI kit (service selection, scheduling, confirmation, and bookings-list screens, plus 11 other full app verticals) that BookLens's booking flow is assembled from wholesale.
- Apple Foundation Models — on-device Apple Intelligence
for the AI Assistant tab, via
LanguageModelSessionand@Generable. - EventKitUI (iOS only) —
EKEventEditViewController, Apple's zero-permission way to add a single event to Calendar without ever requesting broad calendar access. - SwiftData — local persistence for services and appointments.
| Book | Schedule | Confirmed |
|---|---|---|
![]() |
![]() |
![]() |
| My Bookings | Services | AI Assistant |
|---|---|---|
![]() |
![]() |
![]() |
The same SwiftUI codebase, unmodified aside from one platform gate, running natively on macOS — DesignFoundation's cross-platform theming handles the desktop layout automatically. The one deliberate platform difference: "Add to Calendar" is iOS-only (see Architecture below), so the Mac confirmation step simply skips straight to My Bookings.
| Book | My Bookings |
|---|---|
![]() |
![]() |
| Services | AI Assistant |
|---|---|
![]() |
![]() |
- A booking flow built from a real design system —
DFBookingServiceSelectionScreen→DFBookingScheduleScreen→DFBookingConfirmationScreen, wired to real SwiftData services and appointments instead of the vertical's in-memory preview data. - A "My Bookings" calendar —
DFCalendarViewwith a dot marker on any day that has an appointment, above the real bookings list. - Add to Calendar with zero permission prompts, on iOS — confirming a booking presents
EKEventEditViewController(EventKitUI) directly; noNSCalendarsUsageDescriptionprompt, no calendar access requested at all, because the app never reads the user's calendar. This step is iOS-only — see Requirements and Architecture for why it's not ported to macOS. - An on-device AI scheduling assistant — the actual next open slot is always computed
deterministically (
SlotFinder, unit tested); Foundation Models is only asked to narrate why that slot makes sense, so the assistant can never suggest a time that doesn't really exist in the schedule. Gracefully degrades to just the computed slot (no write-up) on devices or OS versions without Apple Intelligence. Works identically on iOS and macOS. - Service management built from DesignFoundation's core components (
DFList,DFEntityRow,DFTextField,DFEmptyState).
-
iOS 18+ or macOS 15+ (the AI Assistant tab additionally requires iOS 26+ / macOS 26+ with Apple Intelligence enabled to generate the write-up; the deterministic next-open-slot logic and the rest of the app work fully on the iOS 18 / macOS 15 baseline)
-
Xcode 26+
-
xcodegen (
brew install xcodegen) — this repo has no committed.xcodeproj; regenerate it fromproject.yml -
A DesignFoundationPro license. This is the one intentional gate: the source here is meant to be read and learned from by anyone, but it only actually builds for someone with access to DesignFoundationPro, since the booking flow is assembled from its
Bookingvertical rather than built from scratch.Without access, package resolution fails outright — you'll see something like this during
xcodegen generate+ build, or from Xcode's own package resolution:error: Failed to clone repository https://github.com/NerdSnipe-Inc/DesignFoundationPro.git: remote: Repository not found. fatal: repository 'https://github.com/NerdSnipe-Inc/DesignFoundationPro.git/' not foundThat's expected, not a bug in this repo: it means your GitHub account isn't on DesignFoundationPro's access list. Grab a license to fix it.
A macOS calendar-integration note: EKEventEditViewController (EventKitUI) — the
zero-permission "present system UI, add one event" API this app relies on for iOS — is
UIKit-only and doesn't exist on macOS. Rather than build out full macOS calendar permission
handling (EKEventStore.requestFullAccessToEvents plus real access UI) for an example app,
BookLens deliberately omits the "Add to Calendar" step on macOS: confirming a booking there
goes straight to My Bookings. See Architecture below for exactly how this is gated.
DesignFoundation (the free SwiftUI design-system core) is public and resolves automatically via Swift Package Manager.
git clone https://github.com/NerdSnipe-Inc/BookLens.git
cd BookLens
xcodegen generate
open BookLens.xcodeprojBuild and run the BookLens scheme (iOS, on a simulator or device) or the BookLensMac scheme
(native macOS app). The app seeds a handful of services and appointments on first launch so the
flow and the assistant have real data immediately, on either platform.
BookLens/
ContentView.swift — four-tab shell: Book, My Bookings, Services, Assistant
Models/
Service.swift — SwiftData model: name, duration, price, icon
Appointment.swift — SwiftData model: date, status, service
SampleData.swift — first-launch seed data
Store/
SlotFinder.swift — pure availability/next-open-slot logic (no SwiftData/SwiftUI/
FoundationModels dependency — unit tested directly)
Booking/
BookingFlowView.swift — wires the Pro Booking vertical's screens to SwiftData + calendar add
AddToCalendarView.swift — EKEventEditViewController wrapper (EventKitUI, zero permissions),
compiled only on iOS via `#if os(iOS)`
MyBookings/
MyBookingsView.swift — DFCalendarView + DFMyBookingsScreen
Services/ — service management (DFList/DFEntityRow + add-service sheet)
Assistant/
SchedulingAssistantEngine.swift — LanguageModelSession + @Generable SchedulingRationale, iOS 26+/macOS 26+
SchedulingAssistantView.swift — loading skeleton, suggestion card, unavailable fallback
The booking flow reuses DesignFoundationPro's Booking vertical screens directly (not its
DFBookingRootView convenience wrapper) because persisting to SwiftData and offering the
EventKitUI add-to-calendar step needs seams that convenience view doesn't expose. See
DesignFoundationPro's own docs for how the vertical is put together.
project.yml defines two application targets — BookLens (iOS) and BookLensMac (macOS) —
that both build from the same BookLens/ source folder. The only platform-conditional code is
in AddToCalendarView.swift and BookingFlowView.swift, both gated with #if os(iOS): the
entire EKEventEditViewController wrapper compiles out on macOS (it's UIKit-only), and
BookingFlowView's confirmation step simply skips presenting it there, going straight to My
Bookings. Everything else — the design system theming, the Booking vertical screens, SwiftData,
and the Foundation Models assistant — is unmodified across platforms.
- DesignFoundation — the free SwiftUI design system this app (and its UI) is built on.
- DesignFoundation Pro — the premium vertical UI kits for Swift (Booking, Analytics, AI Chat, CRM, E-commerce, and more) BookLens's booking flow uses.
- AICompleteChat — the sibling full-source example app: an on-device AI chat client example built the same way.
- BudgetLens — the sibling full-source example app: a SwiftUI budget tracker with on-device AI insights built the same way.
- ScanLens — a sibling full-source example app: a SwiftUI document scanner example built the same way.
- ClientLens — a sibling full-source example app: a SwiftUI CRM example built the same way.
MIT — see LICENSE. Note this only covers the code in this repo; DesignFoundationPro is licensed separately (see its own repo).
Keywords: SwiftUI booking app, appointment scheduler iOS and macOS, cross-platform SwiftUI app iOS and macOS, EventKit calendar integration example, EventKitUI example, SwiftData scheduling app, on-device AI scheduling assistant, Apple Intelligence example, Foundation Models Swift example, LanguageModelSession @Generable, SwiftUI design system, SwiftUI booking UI kit, universal SwiftUI app example, open source iOS and macOS app example.









