Understand the JXPhotoBrowser Architecture
masterJXPhotoBrowser is designed as a lightweight browser kernel that decouples data management from UI rendering. It uses a protocol-driven approach to allow the host application to provide data, media loading, and custom UI elements.
Core Responsibilities of the Kernel:
- Pagination & Reuse: Uses
UICollectionViewto manage paging and cell reuse. - Scaling & Centering: Uses
UIScrollViewto manage single-page zooming and centering. - Transitions: Uses independent animators to manage presentation and dismissal.
- Abstraction: Uses protocols to delegate Cell implementation, Overlays, thumbnail sources, and media content to the business layer.
Key Architectural Layers:
- Host/Business Layer: Provides data and implements the
JXPhotoBrowserDelegate. - JXPhotoBrowserViewController: The central controller managing the
UICollectionView, transition animators, and the Overlay plugin system. - Cell Layer: Implements
JXPhotoBrowserCellProtocol(e.g.,JXZoomImageCell,JXImageCell, or custom video cells).