SwiftUI iOS App Development: Build a Movie & TV App from Scratch
freeCodeCamp.orgOctober 20, 20253h 56min82,251 views
38 connectionsΒ·40 entities in this videoβProject Setup and UI Basics
- π Blossom Movie app is built from scratch using SwiftUI and Xcode.
- π The app features a tabbed interface with Home, Upcoming, Search, and Download sections.
- ποΈ Constants file is created to manage all string literals and icon names, promoting good coding habits.
- πΌοΈ The Home View is designed with a dynamic hero title, and placeholder buttons for trailer playback and downloading.
- π¨ Custom colors, 'Blossom Build Green' and 'Button Text', are added to the Assets catalog for styling.
Horizontal and Vertical Lists
- π¬ Horizontal List View is created to display rows of movie posters, designed to be reusable for different categories like trending and top-rated.
- π± The Home View is enhanced with a scrollable layout containing multiple horizontal lists for trending and top-rated movies and TV shows.
- π Swift Data is introduced for offline storage, allowing users to download and save titles for later viewing.
- β‘οΈ Vertical List View is implemented to display lists of titles, initially populated with sample data.
API Integration and Data Handling
- π The Movie Database (TMDB) API is integrated to fetch movie and TV show data.
- π API Configuration involves storing base URLs and API keys in a JSON file for security and dynamic loading.
- π οΈ Error Handling is implemented using custom enums (
APIConfigError,NetworkError) to gracefully manage issues like missing files or invalid responses. - π Data Fetcher class is created to handle network requests, including building URLs and decoding JSON responses using generics.
- π¬ YouTube API integration is set up to fetch video IDs for trailers, displayed using a
YouTubePlayerwrapper.
Navigation and User Interface
- π§ Navigation Stack is used for managing navigation flow, allowing users to move between screens.
- π A Search View is implemented with a grid layout and a dynamic toolbar that can toggle between movie and TV show searches.
- β¨οΈ A Search Bar is added using the
.searchablemodifier, with debouncing implemented to optimize API calls. - π± View Models (
SearchViewModel,HomeViewModel) are utilized to manage UI state and data fetching logic, adhering to MVVM principles. - β‘οΈ Navigation Links and Navigation Paths are demonstrated for navigating to detail screens and managing navigation history.
Advanced Features and Refinements
- ποΈ Swift Data is used to implement download functionality, allowing users to save and delete titles.
- π Duplicate Prevention and Alphabetical Sorting are added to the downloaded titles list for better data management.
- π Bug Fixing involves addressing navigation issues and improving error display across the app.
- π¨ UI Enhancements include centering progress views and improving the appearance of error messages.
Knowledge graph40 entities Β· 38 connections
How they connect
An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.
Hover Β· drag to explore
40 entities
Chapters18 moments
Key Moments
Transcript856 segments
Full Transcript
Topics13 themes
Whatβs Discussed
SwiftUIiOS DevelopmentXcodeSwiftDataAPI IntegrationThe Movie Database APIYouTube APIMVVM ArchitectureNavigation StackData PersistenceError HandlingUI DesignApp Development Tutorial
Smart Objects40 Β· 38 links
ConceptsΒ· 17
MediasΒ· 7
ProductsΒ· 15
PersonΒ· 1