A lightweight native macOS image viewer built with Swift + AppKit. No Electron, no dependencies — just a small .app bundle compiled directly with swiftc.
- Browse images folder-by-folder with keyboard navigation
- Recursive folder scanning with per-directory sets (↑/↓ to jump between them)
- Adjacent image preloading with a 3-image LRU cache
- Loading spinner with 150 ms delay so fast images don't flash
- Window auto-sizes to each image, capped to the visible screen
- Drag-and-drop a file or folder onto the window to open it
- ESC hides the window without quitting; Dock click brings it back
Supported formats: JPEG, PNG, TIFF, GIF, BMP, WebP, HEIC, HEIF, AVIF, PSD, ICO, ICNS, and RAW (CR2, CR3, NEF, NRW, ARW, SRF, SR2, DNG, RAF, RW2, ORF, PEF, SRW, X3F, 3FR)
Requires macOS 26 and Xcode Command Line Tools (Swift 6.3.1+).
./build.sh # compile, bundle, ad-hoc sign
cp -r ImageViewer.app /Applications/ # installOr run directly from the project directory:
open ImageViewer.app| Key | Action |
|---|---|
| ⌘O | Open Folder… |
| ⇧⌘O | Open File… |
| ← / → or [ / ] | Previous / next image |
| ⌘← / Home | First image in set |
| ⌘→ / End | Last image in set |
| ↑ / ↓ | Previous / next set |
| = or + | Zoom in (1.25×) |
| - | Zoom out |
| 0 | Zoom to fit |
| ESC | Hide window |
| ⌘Q | Quit |
Sources/ImageViewer/
main.swift — entry point
AppDelegate.swift — app logic: window, menus, image loading, cache, navigation
ContentView.swift — DropView (drag-and-drop) + CenteredScrollView
build.sh — compile + bundle script
Everything is programmatic AppKit — no storyboards, no XIBs.