This document explains what each file is for and why it exists.
Lame/
LameApp.swift
ContentView.swift
— iPhone (ImageCaptureCore) —
DeviceManager.swift
MediaFile.swift
FileSystemItem.swift
MediaGridView.swift
MediaItemView.swift
FileBrowserView.swift
— Android (libmtp) —
MTPBridge.swift
AndroidMediaFile.swift
AndroidDeviceManager.swift
AndroidMediaGridView.swift
AndroidFileBrowserView.swift
— Shared —
SizeRangeFilter.swift
SortOptions.swift
AppError.swift
Assets.xcassets/
Lame.xcodeproj/
docs/
Android-Support.md ← new; covers approach, limitations, future options
Architecture.md
…
LameApp.swiftThis is the application entry point.
It creates the single shared DeviceManager and injects it into the SwiftUI environment so child views can read it.
ContentView.swiftThis is the window-level layout.
It creates the two-column structure:
DeviceManager.swiftThis is the most important non-UI file in the app.
It handles:
If you want to understand how the app talks to the iPhone, this is the file to read.
MediaFile.swiftThis is a wrapper around ICCameraFile.
It exists because raw framework objects are not convenient for SwiftUI rendering. The wrapper adds:
isVideoMediaGridView.swiftThis is the main interface users work with.
It manages:
It does not own device communication. It asks DeviceManager to perform those operations.
MediaItemView.swiftThis is one grid cell.
It displays:
SortOptions.swiftThis file contains small enums that define sorting choices. It is pure value logic and intentionally simple.
SizeRangeFilter.swiftThis file contains two related things:
MediaGridViewThe filter supports:
AppError.swiftThis centralizes app-specific error messages and lets the rest of the code use typed errors instead of ad hoc strings.
These files implement Android MTP device support. They depend on libmtp being installed via Homebrew. For a detailed explanation of the design decisions, see docs/Android-Support.md.
MTPBridge.swiftThis is the subprocess interface for libmtp.
It is a Swift actor that serialises all calls to the libmtp command-line tools (mtp-detect, mtp-files, mtp-thumb, mtp-getfile, mtp-delfile). The actor keyword guarantees that only one MTP operation runs at a time, which the MTP protocol requires.
The file also contains the output parsers that turn text from mtp-files into MTPFileInfo value types.
AndroidMediaFile.swiftThis is the Android equivalent of MediaFile.swift.
It wraps an MTPFileInfo value type and adds SwiftUI observation support, per-item thumbnail state, and formatted display values. It also conforms to RangeFilterMatchable so the same filter panel used for iPhones works for Android files without modification.
AndroidDeviceManager.swiftThis is the Android equivalent of DeviceManager.swift.
It manages:
ioreg to detect Android devicesmtp-detectmtp-filesmtp-delfileAndroidMediaGridView.swiftThis is the Android equivalent of MediaGridView.swift.
It provides the same photo and video grid with search, sort, size and date filtering, pinch-to-zoom, multi-select, and delete. It reads from AndroidDeviceManager instead of DeviceManager.
The file also contains AndroidMediaItemView, which is the single-cell component for the Android grid.
AndroidFileBrowserView.swiftThis is the Android equivalent of FileBrowserView.swift.
It provides a folder-tree browser showing the complete MTP file system. Folder navigation is instant because AndroidDeviceManager builds the entire parent-child tree in memory during enumeration. Double-clicking a folder pushes it onto the breadcrumb stack.
These files serve both the iPhone and Android paths.
SizeRangeFilter.swiftThis file now contains three things:
RangeFilterMatchable — a protocol with fileSize and creationDate properties, implemented by both MediaFile and AndroidMediaFileRangeFilter) used by both grid viewsRangeFilterPanel) shown in both grid toolbarsSortOptions.swiftUnchanged. The same SortField and SortOrder enums are used by both MediaGridView and AndroidMediaGridView.
Lame.xcodeprojThis directory stores the Xcode project definition, build settings, target configuration, and workspace metadata.
Most application logic is not here. New contributors usually only touch this area when:
Assets.xcassetsThis stores app icons and other visual assets managed by Xcode’s asset system.
A quick mental model:
LameApp.swiftContentView.swiftDeviceManager.swiftMediaFile.swiftMediaGridView.swiftMediaItemView.swiftSortOptions.swift, SizeRangeFilter.swift, AppError.swift