Skip to content

AnbalaganD/PhotoViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhotoViewer

A SwiftUI-based iOS app that displays photos from JSONPlaceholder API with smart caching and compression.

Features

  • 📱 Browse 5,000 photos in a smooth, scrollable list
  • 🔍 View photo details with editable titles
  • 💾 Intelligent LRU cache with Brotli compression
  • 🚀 Async/await networking with proper error handling
  • ⚡ Memory pressure monitoring and auto-cleanup
  • ✅ Unit tested cache implementation

Tech Stack

  • UI: SwiftUI with NavigationStack
  • Architecture: MVVM pattern
  • Networking: URLSession with async/await
  • Caching: Custom LRU cache with linked list
  • Compression: Brotli algorithm for optimal storage
  • Concurrency: Swift Concurrency (@Sendable, @MainActor)

Requirements

  • Xcode: 15.0+
  • iOS: 15.0+

Getting Started

  1. Clone the repository
  2. Open PhotoViewer.xcodeproj in Xcode
  3. Select a simulator or device
  4. Run the project (Cmd + R)

Architecture Highlights

  • Protocol-driven design for testability and flexibility
  • Automatic memory management with cache eviction on memory pressure
  • Image compression reduces memory footprint by ~60-80%
  • Dependency injection for easy testing and mocking

About

Load image asynchronously and stored in InMemory cache. It will help you to reduce overall network traffic, image loading time and improve the app responsive time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages