/nd-TheMovieManager

Native iOS mobile app client for https://www.themoviedb.org

Primary LanguageSwiftMIT LicenseMIT

TheMovieManager

iOS client app for theMovieDB api. It allows users to login using their theMovieDB credentials.

An authenticated user can search for movies, view the movie poster, add to his/her watchlist and add to his/her favorites list.

Screenshots

Implementation

Main Entry Point into the app

  • SceneDelegate.swift file scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)
  • It determines the appropriate root viewcontroller to display.
  • LoginViewController if the user is not logged in and the UITabViewController if the user is logged in

Features

  • CoreData: stores user favorite and watchlist movies, implemented in Services/DataController.swift
  • Model/TheMovieManager.xcdatamodeld holds the CoreData model with the following fields,
  • id: Int32 - The movie id
  • title: String - The title of the movie
  • favorite: Boolean - Indicates if the movie has been added to favorites list
  • watchlist: Boolean - Indicates if the movie has been added to watchlist
  • posterPath: String - The poster image path, which is being resolved in Constants.swift to https://image.tmdb.org/t/p/w500/$path
  • releaseDate: Date - The date the movie was released
  • UserDefaults: stores the sessionId credential for theMovieDB API, implemented in Services/Auth.swift
  • Alamofire: HTTP networking library
  • The router is set up in Mode/TMDB Client/TMDBRouter.swift
  • The api client is set up in Mode/TMDB Client/TMDBClient.swift
  • Kingfisher: library for downloading and caching movie poster images
  • Used in MovieDetailViewController.swift to load the poster image

How to build

pod install
  • Open TheMovieManager.xcworkspace in Xcode

  • Update your moviedb API key in Model/Constants.swift

  • Run the app

Requirements

  • Xcode 12
  • Swift 5

Dependencies

  • CoreData - for storing user favorite and watchlist movies
  • Alamofire - for making API networking calls
  • Kingfisher - for downloading and caching movie poster images

License

MIT