$ show ZhipingYang/UUChatTableView
UUChatTableView is a lightweight Objective-C iOS library providing a chat UI surface with text, image, and voice message support. The core library (Class/) includes a message model (UUMessage), layout frame calculator (UUMessageFrame), a bubble cell renderer (UUMessageCell) with a custom content button (UUMessageContentButton), a full-featured input bar (UUInputFunctionView) with voice recording and media actions, an audio player (UUAVAudioPlayer), an image browser (UUImageAvatarBrowser), and a voice recording HUD (UUVoiceRecordingHUDView). The library is distributed via CocoaPods and includes a pure-code demo application (Demo/) that showcases private and group chat scenarios with text, image, and voice messages, plus pull-to-load history and interactive UI elements. The architecture follows a delegate-driven pattern where the input bar notifies the view controller of user actions, and the data source manages message creation and layout computation. The codebase is well-structured, uses modern iOS APIs (PHPickerViewController, SF Symbols, iOS 13+), and demonstrates high craftsmanship with reusable, self-contained components.
The LLM identified 4 files worth highlighting for reuse:
A pure-code input bar that provides text entry, voice recording with a waveform HUD, photo library and camera access, and extensible custom action items. Handles permissions (microphone, camera, photo library) with settings alerts, manages recording lifecycle, and communicates via a delegate protocol. Can be extracted and reused in any chat app with minimal modification.
A self-contained voice recording HUD with a blur background, microphone icon, timer, animated waveform level bars, and cancel state. Uses Auto Layout constraints and adaptive sizing based on text content. The waveform animation and cancel UI are well-implemented and reusable as a standalone overlay for any recording feature.
A custom UIButton that renders chat bubble backgrounds with rounded corners and shadows using CAShapeLayer. Supports text, image, and voice content states with voice playback animation. Implements copy menu for text messages via canBecomeFirstResponder. The bubble styling is decoupled from the cell and can be reused in any chat UI.
A layout calculator for chat message cells that computes frames for time label, avatar, name, and content bubble based on message type (text, image, voice). Handles dynamic text sizing, image fitting, voice duration-based width, and positioning for sent/received messages. Decoupled from the cell view, making it easy to reuse or test layout logic independently.