Coder Social home page Coder Social logo

periclesm / tmdb-search Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 673 KB

A sample iOS application performing a search on the Movie Database and returning results. Written in swift and UIKit.

License: GNU General Public License v3.0

Ruby 1.10% Swift 98.90%
rest-api tmdb-api ios swift swift5

tmdb-search's Introduction

The Movie Database Search

General:

An app performing a search on the Movie Database according to user input and displays results from the TMDB API. Then, on user selection, it shows additional information for the selected movie.

Is written in Swift and using UIKit with Storyboards for it's views and stores data in a simple memory object.

Has some basic unit testing to check the API, data parsing and pagination (fetch consecutive data).

Classes Description

Model:

  • Objects
    • SearchResponse and GenreResponse: Contain the payload from the TMDB response.
    • Movie: a struct object containing the necessary information for a single movie.
    • Genre: Contains the Genre Struct object to be used for naming moving genres.
  • DataStore: A generic memory store for the data been fetched from TMDB API. On a larger app, this would have been a SQLite/Realm database or Core Data.
  • DataAPI: Constructs and returns the API endpoints for each data category:
    • Movie Search: Searches for movies given a search term,
    • Genre: Fetches all TMDB genres, stores them in memory and uses where necessary,
    • Image: Fetches an image type (backdrop or poster) for a given image path.
  • DataManager: A class containing methods for fetching, parsing and storing data requested from the TMDB API. Used for search movies, genres and images. (_Note: Error handling has not been thoroughly implemented).

View

View contains several elements that make the app's UI:

  • Storyboards: The storyboards with the VCs used in the app.
  • Components: Classes and objects that provide common and reusable code. In this case, UITableView cells and cellForRow() UITableView methods. The idea is to create cell templates to be reused multiple times in different controllers throughout the app (again, the assessment is too simple to justify that but I'm just exposing the idea).
  • View Models: SearchVM and MovieVM contain methods that control the data flow between the Model (M) and the Views (V). A simple implementation of the MVVM architecture model.
  • ViewControllers: The actual Views of the app. SearchVC and MovieVC are UITableViewControllers while BackVC and ContentVC are generic ViewControllers. BackVC is displayed as UITableView background of the SearchVC and follows it's own routing (thus the separate storyboard)

System

System section contains classes performing actions related closely to the OS and/or extending/subclassing/sharing iOS SDK classes for the purposes of the app:

  • Network: A simple networking class fetching data and performing basic checks.
  • Image Manager: A manager class for Kingfisher image extension.
  • MDDate: With DateFormatter being an expensive allocation when used for each UITableViewCell, a shared instance initialiing a DateFormatter once with specific parameters is used across the app to cover the needs of all date conversions and formatting from the API date string into the app's desired format.

tmdb-search's People

Contributors

periclesm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.