-
Install Xcode
-
Clon or Download MovieSearch for iOS Source Code or https://github.com/pipemontoya/MovieSearch
-
Open the project location Then, run the following comands:
$ pod install
if you have not installed Cocoapods , you can install it with Homebrew using the following command:
$ gem install cocoapods
$ carthage update --platform iOS
if you have not installed Carthage yet, you can install it with Homebrew using the following command:
$ brew update $ brew install carthage
-
Open "MoviewSearch.xcworkspace" in Xcode.
-
Connect your iPad or iPhone using USB and select it in Xcode's Product menu > Destination.
-
Press CMD+R or Product > Run to install MovieSearch.
Below is the layers that are in the application, there is no persistence layer within the app because I did not find it necessary to have a small application that works with cache (inside the network layer).
-
Animator.swift
Responsability: Animate detail of cell.
-
ApiService.swift
Responsability: Bring the data from the server to convert them into models within the app
-
PagerViewModel.swift
Responsability: Create views to page the categories
-
MoviesViewModel.swift
Responsability: Manage objects to update movies.
-
MoviesDetailViewModel.swift
Responsability: Manage objects to show movie choosed details brought from Movies.
-
OnlineSearchViewModel.swift
Responsability: Manage objects to search movies by name online.
Responsability: Communicates the view with viewModels.
- PagerViewController.swift
- MoviesViewController.swift
- MovieDetailViewController.swift
- OnlineSearchViewController.swft
- VideoViewController.swift
Responsability: Contains all ViewControllers with its views.
- Main.storyboard
- Movies.storyboard
- Video.storyboard
Responsability: Show data of the objects brought from ViewModels.
- MovieTableViewCell.swift
- MovieDetailTableViewCell.swift
- MoreTableViewCell.swift
- OnlineCollectionViewCell.swift
Responsability: Create effects (blur and shadow) in classes iherited from UIView class.
- UIView.swift
Responsability: Show data brought from server in objects inside the application.
- Movie.self
- Video.self
- El principio de responsabilidad única consiste en que cada clase debe realizar una sola cosa, es decir, por ejemplo se tiene una 'arquitectura' MVVM y se tiene un ViewModel, este solo debe realizar la operacion de datos del controlador. su responsabilidad es operar y actualizar todos los datos mostrados en la vista.
- Para mi un codigo limpio debe ser un código que sea legible para cualquier desarrollador no importa su nivel, es decir que cualquier desarrollador que trabaje sobre el código, logre entender cual es la idea del proyecto y lo que hace. También debe tener buenas prácticas tales tener un código bien identado, buenas convenciones para variables y constantes, tener en cuenta las lineas de código de cada método, y algo que en mi concepto es importante es programar en ingles ya que es universal y cualquiera puede entender más facil el código, etc.