Skip to content

devcarlos/TheMovieDBApp

Repository files navigation

TheMovieDBApp

The Movie App Swift - iOS Application to handle The Mobie DB challenge using Xcode 12.4 and Swift 5.3

Architecture

The app is using MVVM architecture, the main goal is to mantain everything under a simple but effective MVVM implementation.

  • Modules

    Each Module has ViewModel, Models, Views to handle the base Architecture design.

  • ViewModels

    ViewModel is the main component of this architecture pattern. ViewModel never knows what the view is or what the view does. This makes this architecture more testable and removes complexity from the view. The ViewModel invokes changes in the Model and updates itself with the updated Model, and since we have a binding between the View and the ViewModel, the first is updated accordingly.

  • Models

    Model refers either to a domain model, which represents simple data.

  • Network Layer

    Network layer is a set of Services Protocols to handle the API calls to the Endpoints using an Adapter and Protocol Oriented programming.

Please consider this article if it is your first time using MVVM: https://medium.com/@azamsharp/mvvm-in-ios-from-net-perspective-580eb7f4f129

Frameworks

The app is using some external frameworks dependencies using Cocoapods:

  • Alamofire

    • A network layer to handle REST API requests for HTTP request, used to implement the Service Network API calls.
  • SDWebImage

    • A framework to handle image URL downloads easy and quick to download and display the Movie Posters
  • SwiftLint

    • A framework to handle best practices lint rules for Swift used as a best practice

Installation

This project use Xcode 12.4 and CocoaPods for dependencies,

  1. Clone Repo:
    git clone git@github.com:devcarlos/TheMovieDBApp.git

  2. CD Directory:
    cd TheMovieDBApp

  3. Install dependencies:
    pod install

  4. Open Project:
    open TheMovieDBApp.xcworkspace

  5. Build and Execute:
    build using Xcode CMD + R using a Simulator or Device

Structure

In the root of the project we found this folder structure and files:

|-- TheMoviewDBApp
  |-- App
  |-- Assets
  |-- Common
  |-- Extensions
  |-- Network
  |-- Modules
    |-- Home
        |-- Views
          |-- Cells
          |-- Storyboards
          |-- Controllers
        |-- Models
        |-- ViewModel
      |-- MovieDetails
        |-- Views
          |-- Cells
          |-- Storyboards
          |-- Controllers
        |-- Models
        |-- ViewModel
  |-- Storyboards
  |-- SupportFiles
    |-- Info.plist
|-- Podfile
|-- Podfile.lock
|-- LICENSE
|-- README.md
|-- RESULTS.json
|-- .gitignore

Where all app code is hosted in TheMovieDBApp folder, all the Info.plist settings files for xcode project are hosted in SupportFiles. For each module of the app we use the folder structure show it in Modules folder.

About

The Movie App Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors