A simple UIKit-based iOS app that displays movies from The Movie Database (TMDb) API using UICollectionViewCompositionalLayout and DiffableDataSource.
- Fetches and displays:
- ποΈ Popular Movies in a horizontally scrolling carousel
- π Upcoming Movies in a vertically scrolling 3-column grid
- Uses UICollectionViewCompositionalLayout for flexible layouts
- Smooth updates with UICollectionViewDiffableDataSource
- Section headers with titles and pinning behavior
- Loading indicator while fetching movies
- Clean Architecture with proper separation of concerns (Data, Domain, Presentation layers)
- Network Interceptor for request/response handling and customization
- Dependency Injection (coming soon...)
- Combine + URLSession for reactive network requests
- Modular and scalable code structure
This app uses a single compositional layout configured via a closure:
- Scroll direction: Horizontal
- Item size: 140pt width Γ estimated 250pt height
- Group: Vertical group with one item per group
- Usage: Featured movies carousel
- Scroll direction: Vertical
- Grid: 3 columns per row
- Item width: 1/3 of the screen
- Item height: Estimated (~320pt)
- Usage: Movie release schedule or future films
| File | Description |
|---|---|
ViewController.swift |
Main controller handling layout, data source, and fetching |
MovieCell.swift |
Custom UICollectionViewCell to display movie info |
SectionHeaderView.swift |
Reusable header view with title for each section |
MovieModel.swift |
Model representing a movie, conforms to Hashable |
APIManager.swift |
Handles TMDb API requests and decoding |
- Clone this repo
- Insert your TMDb API key inside
APIManager.swift - Open the project in Xcode (targeting minimum iOS 13)
- Run on simulator or real device
Combined view showing both sections:
- Popular Movies at the top (horizontal scroll)
- Upcoming Movies below (grid layout)
UI preview coming soon...
- iOS 13+
- Swift 5
- No third-party dependencies
MIT License
Developed by [Your Name] β feel free to reach out for feedback or collaboration!