Skip to main content

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 YouTubePlayer wrapper.

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 .searchable modifier, 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