MovieFlix is an iOS application built with Swift that allows users to browse popular movies, search for specific titles, and view detailed information about each movie. The app uses the TMDB (The Movie Database) API for all movie data.
- Popular Movies List: Browse a list of currently popular movies
- Infinite Scrolling: Automatically loads more movies as you scroll
- Pull-to-Refresh: Refresh the movie list by pulling down
- Real-time Search: Search for movies with instant results as you type
- Favorite Movies: Mark movies as favorites with persistent storage
- Skeleton Loading: Beautiful loading placeholders while data is being fetched
- Comprehensive Information:
- Movie poster and backdrop image
- Title, genres, release date, and runtime
- Star rating
- Movie description
- Cast members with photos
- User reviews (up to 2)
- Similar movies recommendations
- Favorite Toggle: Mark/unmark movies as favorites
- Share Functionality: Share movie homepage URL via iOS native share sheet
- Parallel API Calls: Efficiently loads multiple data sources simultaneously
- Graceful Degradation: Displays details even if non-critical data (reviews, similar movies) fails to load
- MVVM Pattern: Clean separation of concerns with ViewModels
- Hybrid UI: UIKit for the home screen, SwiftUI for detail screen (as required)
- No External Dependencies: Uses only native iOS frameworks
- NetworkManager: Centralized networking layer with generic request handling
- FavoritesManager: Persistent storage using UserDefaults
- ImageLoader: Efficient image caching and loading with Combine
- SkeletonView: Custom skeleton loading animations for both UIKit and SwiftUI
- Popular Movies endpoint with pagination
- Search Movies endpoint with pagination
- Movie Details with credits
- Movie Reviews (separate call, non-critical)
- Similar Movies (separate call, non-critical)
- iOS 14.0+
- Xcode 14.0+
- Swift 5.0+
- TMDB API Key
- Visit The Movie Database
- Create a free account or sign in
- Go to Settings > API
- Request an API key (it's free for non-commercial use)
- Copy your API Key
- Open the project in Xcode
- Navigate to
MovieFlix/Config.swift - Replace
YOUR_API_KEY_HEREwith your actual TMDB API key:
static let apiKey = "your_actual_api_key_here"- Select a simulator or connected device (iPhone)
- Press
Cmd + Rto build and run - The app should launch and display popular movies
MovieFlix/
├── MovieFlix/
│ ├── AppDelegate.swift
│ ├── SceneDelegate.swift
│ ├── Config.swift # API configuration
│ ├── Models/
│ │ ├── Movie.swift # Movie list model
│ │ ├── MovieDetailResponse.swift # Movie details, credits
│ │ ├── ReviewResponse.swift # Reviews model
│ │ └── SimilarMoviesResponse.swift # Similar movies
│ ├── Views/
│ │ ├── MovieCell.swift # UIKit table view cell
│ │ ├── MovieDetailView.swift # SwiftUI detail screen
│ │ └── SkeletonView.swift # Skeleton loaders
│ ├── ViewControllers/
│ │ └── HomeViewController.swift # UIKit home screen
│ ├── Managers/
│ │ ├── NetworkManager.swift # API networking
│ │ └── FavoritesManager.swift # Favorites persistence
│ ├── Utilities/
│ │ └── ImageLoader.swift # Image caching
│ ├── Assets.xcassets/
│ ├── LaunchScreen.storyboard
│ └── Info.plist
└── MovieFlix.xcodeproj/
Implemented in HomeViewController using tableView(_:willDisplay:forRowAt:):
- Triggers when user scrolls near the bottom (last 3 items)
- Automatically fetches next page of results
- Works for both popular movies and search results
- Uses
UIRefreshControlon the table view - Resets to page 1 and refreshes current mode (popular or search)
- Real-time search with 0.5-second debounce
- Automatically switches between popular movies and search results
- Maintains separate pagination for search results
- Custom skeleton views for both UIKit and SwiftUI
- Shimmer animation effect
- Displays while content is loading
Movie detail screen uses DispatchGroup to:
- Load movie details (critical)
- Load reviews (non-critical)
- Load similar movies (non-critical)
- Screen displays with details even if optional data fails
- Stored in
UserDefaults - Persists across app launches
- Instant UI updates on toggle
NSCachefor in-memory caching- Prevents redundant network requests
- Automatic memory management
- UIKit for Home, SwiftUI for Details: As per requirements, demonstrating proficiency in both frameworks
- No Third-Party Libraries: Implemented all features using native iOS frameworks
- MVVM Architecture: Clean, testable, maintainable code structure
- Defensive Programming: Graceful error handling, optional data handling
- Performance Optimization: Image caching, debounced search, efficient scrolling
The app has been tested on:
- iPhone 14 Pro Simulator (iOS 17.0)
- Portrait orientation only
- Various network conditions
- Edge cases (empty states, errors, missing data)
Possible improvements for production:
- Unit tests for ViewModels and Managers
- UI tests for critical user flows
- Error state UI with retry functionality
- Offline mode with Core Data
- Pagination indicator
- Advanced filtering and sorting
- Movie trailers integration
- User authentication
- Personal watchlist
- iOS 14+ support
- Swift 5.0+
- No external libraries (only Apple frameworks)
- Home screen in UIKit
- Movie details screen in SwiftUI
- Popular movies list
- Infinite scrolling
- Pull-to-refresh
- Real-time search
- Favorite functionality with persistence
- Skeleton loader
- Movie details with all required fields
- Parallel API calls (no append_to_response for reviews/similar)
- Share functionality
- Non-critical data handling (reviews, similar movies)
- Star rating display
- Cast information
- Navigation between screens
GET /movie/popular- Popular movies with paginationGET /search/movie- Search movies with paginationGET /movie/{id}?append_to_response=credits- Movie details with castGET /movie/{id}/reviews- Movie reviews (separate call)GET /movie/{id}/similar- Similar movies (separate call)
This project was created as part of a technical assessment for ATCOM.
For any questions or clarifications, please contact: Petros Dhespollari
Note: Remember to add your TMDB API key in Config.swift before running the app!