Architecture

A small monorepo: one shared Swift package with the data model, and two thin native apps (macOS and iOS) built on top of it. Pure Swift — SwiftUI + AppKit on the Mac, SwiftUI on iOS.

Repository layout

Packages/MemoryKit/   shared models and rules: items, Boards, retention, persistence, sync interfaces
apps/macos/           macOS app (clipboard monitor, panel, Boards, reminders, pasting)
apps/ios/             iOS app (local memory, gestures, details, Boards, reminders)
Resources/Info.plist  Info.plist for the macOS build
project.yml           XcodeGen configuration → generates MemoryApp.xcodeproj
build.sh              fast macOS build via SwiftPM (no Xcode needed)

MemoryKit — the shared core

Packages/MemoryKit is a Swift package containing the data model shared by both apps. It deliberately depends on Foundation and CryptoKit only — no AppKit, no UIKit — so it compiles unchanged on macOS and iOS.

macOS app (apps/macos)

ComponentResponsibility
ClipboardMonitorWatches NSPasteboard by polling its change counter; classifies new content, honors the org.nspasteboard confidentiality convention and the app exclusion list.
HistoryStoreOwns items and Boards: atomic archive persistence, blob storage, deduplication, time-based retention, Board membership, Loved/Saved state, reminder scheduling and legacy migration.
PanelControllerThe slide-up recall panel. A non-activating panel (Spotlight pattern), so the frontmost app keeps focus while you browse.
HistoryViewSwiftUI content of the panel: global search, type filters, card grid, quick Loved/Saved actions, Board and reminder menus, keyboard navigation, drag & drop and context menus.
LibraryViewAll-Boards navigation, Board editor, per-Board item views and item detail/reminder sheets.
ReminderSchedulerRequests notification permission, schedules/cancels local item notifications and routes an opened notification to its stable item ID.
HotkeyManagerRegisters the global V shortcut.
PasteHelperPastes into the active app by synthesizing ⌘V (CGEvent); requires the Accessibility permission. Plain-text paste variant for ⌥↩.
SettingsViewPreferences: retention (30/60/90/120 days or forever), excluded apps and launch at login.
ColorHexParsing/rendering of HEX colors for color previews.
main.swiftApp bootstrap: menu-bar item (🧠), wiring of monitor, store, panel and hotkey.

iOS app (apps/ios)

The iOS app (bundle id cc.memoryapp.ios) is a native client for the same memory as the Mac app, kept in sync via iCloud in signed builds. It supports global search, left-to-Deleted/right-pin swipes, tap-to-detail, long-press actions, Loved/Saved, named Boards, reminders and safe opening for recognized web links.

ComponentResponsibility
MemoryAppApp / IOSAppDelegateSwiftUI entry point plus notification category setup and response routing to an item ID.
IOSStoreLocal item and Board store: search, membership, reminders, retention, archive persistence and the sync interface (active in signed builds).
ContentViewMemory list, search, quick Loved/Saved buttons, swipe actions, long-press menus and add-from-clipboard.
IOSItemDetailViewDetail sheet, safe web-link opening, Board membership and reminder editor.
IOSBoardsViewAll-Boards overview, custom Board management and Board-scoped item lists.
IOSReminderSchedulerLocal notification authorization, scheduling, cancellation and reconciliation.

Data flow (macOS)

copy in any app
      │
      ▼
NSPasteboard ──(polling)──▶ ClipboardMonitor
                                  │  classify (text/link/color/image/file)
                                  │  skip confidential + excluded apps
                                  ▼
                            HistoryStore ──▶ versioned archive + blobs/
                                  │  dedup + Boards + reminders + retention
                                  ▼
⌘⇧V ──▶ HotkeyManager ──▶ PanelController ──▶ HistoryView
                                  │
                     click / ↩ / drag & drop
                                  ▼
                    clipboard  ──▶ PasteHelper (⌘V into the active app)

Build system

iCloud sync architecture

Signed, entitled builds use CloudKitSyncEngine by default and keep an offline local copy. Items, Deleted state and Board definitions travel through the user's private CloudKit database; SyncPocket App runs no data server and cannot read anyone's archive. Every item carries modifiedAt: the newest change wins, Deleted wins an exact-time tie, and a conflicting save is retried with the latest server change tag. Isolated UI tests use NoopSyncEngine. Shipping remains gated on a signed production container and a two-device conflict test.