A modern iOS application that allows users to explore popular movies using The Movie Database (TMDB) API. Built with Clean Architecture and MVVM design patterns, featuring pagination, search, caching, analytics, and full accessibility support.
- Grid Layout: Browse popular movies in a responsive grid
- Movie Details: SwiftUI-powered detail screens with comprehensive information
- Pagination: Infinite scroll with automatic loading
- Search: Real-time, debounced search with cancellation support
- Favorites: Local storage with persistent favorites management
- Caching: Multi-layer caching (memory + disk) for optimal performance
- Analytics: Telemetry tracking for user behavior and app performance
- Accessibility: Full VoiceOver support with semantic labels
- Error Handling: Robust error states with retry mechanisms
- Modern UI: Dark theme with smooth animations
| Feature | Implementation | Key Components | Rationale |
|---|---|---|---|
| Detail Screen | SwiftUI + UIKit Bridge | Detail View, ViewModel, Action Buttons | Modern declarative UI with better accessibility |
| Pagination | Infinite Scroll | Movies ViewModel, View Controller | Automatic loading with page tracking |
| Search | Debounced, Cancellable | Movies ViewModel, View Controller | 400ms debounce prevents excessive API calls |
| Structured Concurrency | async/await + Task Management | ViewModels, Network Service, Retry Utility | Modern Swift concurrency with proper cancellation |
| SwiftUI | Hybrid Architecture | Detail View, Action Buttons | Better accessibility and modern UI patterns |
| Accessibility | VoiceOver Support | Movie Cells, Detail View, Action Buttons | Comprehensive accessibility labels and hints |
| Testing | Unit Tests + Swift Testing | ViewModel Tests, Cache Tests | Focus on pagination, search, error paths |
| Security | API Key Management | Configuration Files, Git Ignore | Secure API key storage |
| CI/CD | GitHub Actions | Workflow Files, Project Configuration | Automated testing on multiple Xcode versions |
- Storage: UserDefaults for favorites; Core Data would provide better scalability
- Localization: English-only interface
- Advanced Search: Basic text search only; could add filters (genre, year, rating)
Clean Architecture with MVVM pattern ensuring clear separation of concerns and testability.
UI (UIKit/SwiftUI) → ViewModel → UseCase → Repository → NetworkService/CacheService
- UIKit Views: MoviesViewController, MovieCell for list/grid display
- SwiftUI Views: MovieDetailView, ActionButtons for modern detail experience
- ViewModels: MoviesViewModel, MovieDetailsViewModel with reactive state management
- Entities: Movie model with Codable support
- Use Cases: GetPopularMoviesUseCase with retry logic
- Protocols: Repository and service contracts for dependency inversion
- Network: NetworkService with Alamofire, connectivity checks, and error handling
- Repository: MovieRepository with caching layer integration
- Services: FavoritesService, CacheService for local data management
- Alamofire: Network requests with async/await support
- SDWebImage: Efficient image loading and caching
- TelemetryDeck: Privacy-focused analytics and telemetry
-
Clone the repository
git clone https://github.com/kirlosyousef/Cineverse.git cd Cineverse -
Configure API Key Create a
Secrets.xcconfigfile in the project root:# Get your API key from https://www.themoviedb.org/settings/api echo "TMDB_API_KEY = your_api_key_here" > Secrets.xcconfig
-
Add to Xcode Project Configuration
- Open
Cineverse.xcodeproj - Select the project in the navigator
- Go to "Info" tab
- Add
Secrets.xcconfigto the "Configuration Files" section - Ensure both Debug and Release configurations reference the file
- Open
-
Build and Run
# Using Xcode open Cineverse.xcodeproj # Press Cmd+R to build and run # Using command line xcodebuild -project Cineverse.xcodeproj -scheme Cineverse -destination 'platform=iOS Simulator,name=iPhone 16' build
- Unit Tests: Focus on pagination, search, error handling, and data layer
- Mock Objects: Comprehensive mocking for network and data services
- Test Coverage: MoviesViewModelTests, CacheServiceTests, MovieDetailsViewModelTests
- VoiceOver: Full support with semantic labels and navigation hints
- Dynamic Type: Support for system font size preferences
- Accessibility Identifiers: Unique identifiers for UI testing
- GitHub Actions: Automated testing on macOS 14 with Xcode 16.2
- Build Matrix: Tests on multiple Xcode versions
- Test Results: Automated collection and reporting with artifacts
- Choice: Simple key-value storage for favorites
- Rationale: Quick implementation with automatic persistence
- Trade-off: Limited scalability; Core Data would be better for production
- Choice: Memory + disk caching with SDWebImage
- Rationale: Optimal performance with offline capability
- Trade-off: Increased memory usage; configurable limits prevent issues
- Choice: Three-layer architecture with dependency injection
- Rationale: Clear separation of concerns and testability
- Trade-off: More boilerplate code but better maintainability
# In Xcode
Cmd+U
# Command line
xcodebuild test -project Cineverse.xcodeproj -scheme Cineverse -destination 'platform=iOS Simulator,name=iPhone 16'- iOS: 17.0+
- Xcode: 16.0+
- Swift: 5.9+
This project is available under the MIT license. See the LICENSE file for more info.