A SwiftUI iOS app for browsing trending and top-rated movies and TV shows, powered by the TMDB API with YouTube trailer playback, search, and offline downloads via SwiftData.
- Home - Browse trending and top-rated movies and TV shows with a rotating hero banner
- Upcoming - View upcoming movie releases
- Search - Search for movies and TV shows with debounced input and media type toggle
- Downloads - Save titles locally with SwiftData for offline access, with swipe-to-delete
- Trailer Playback - Watch YouTube trailers embedded in the title detail view
| Home | Upcoming | Search |
|---|---|---|
![]() |
![]() |
![]() |
- SwiftUI with tab-based navigation and
NavigationStack - SwiftData for local persistence of downloaded titles
- @Observable view models with state-driven UI (
notStarted,fetching,success,failed) - Concurrent networking using
async letfor parallel API requests - Reusable components -
HorizontalListViewandVerticalListViewused across multiple screens
Flix/
├── FlixApp.swift # App entry point with SwiftData container
├── ContentView.swift # Tab navigation (Home, Upcoming, Search, Downloads)
├── HomeView.swift # Trending and top-rated content with hero banner
├── UpcomingView.swift # Upcoming movies list
├── SearchView.swift # Search with debounce and media type toggle
├── SearchViewModel.swift # Search state management
├── DownloadView.swift # Saved titles via SwiftData @Query
├── TitleDetailView.swift # Title details with YouTube trailer and download
├── HorizontalListView.swift # Horizontal scrolling poster carousel
├── VerticalListView.swift # Vertical list with optional swipe-to-delete
├── YoutubePlayer.swift # WKWebView wrapper for YouTube embeds
├── DataFetcher.swift # Networking layer for TMDB and YouTube APIs
├── ViewModel.swift # Shared view model for home, upcoming, and detail views
├── Title.swift # SwiftData @Model with Decodable conformance
├── YoutubeSearchResponse.swift # YouTube API response models
├── Constants.swift # String constants, URLs, and view modifiers
├── Errors.swift # Custom error types for networking and configuration
├── APIConfiguration.swift # JSON-based API config loader
└── APIConfiguration.json # API keys and base URLs (git-ignored)
- TMDB API - Movie and TV show metadata, posters, and search
- YouTube Data API v3 - Trailer search by title
- Clone the repository
- Create a
Flix/APIConfiguration.jsonfile with your API keys:{ "tmdbBaseURL": "https://api.themoviedb.org", "tmdbAPIKey": "YOUR_TMDB_API_KEY", "youtubeBaseURL": "https://www.youtube.com/embed", "youtubeAPIKey": "YOUR_YOUTUBE_API_KEY", "youtubeSearchURL": "https://www.googleapis.com/youtube/v3/search" } - Open
Flix.xcodeprojin Xcode - Build and run
- iOS 17+
- Xcode 16+
- TMDB API key
- YouTube Data API v3 key


