Code challenge iOS - Movies app

Overview

Code challenge iOS - Movies app

Project structure

  • The Common folder contains shared code across all features.
.
├── Constants.swift -> global constants used in the app
├── Entities
│   ├── ContentAdapter.swift      -> a protocol for adapting movies/series data to UI Components
│   ├── ContentEntity.swift       -> a class representing the local DB model for realm
│   ├── ContentResponse.swift     -> a struct to handle responses data from the API (acts as a wrapper for movies/series)
│   ├── Movie.swift               -> a struct to handle movies data from the API
│   └── Serie.swift               -> a struct to handle series data from the API
├── Enums
│   ├── Category.swift            -> an enum to handle Categories (popular, top rated and upcoming)
│   └── ResourceType.swift        -> an enum to handle the type of resource for the API (movies or series)
├── Networking
│   ├── HTTPClient
│   │   ├── HTTPClient.swift      -> a class to handle http requests
│   │   └── Resource.swift        -> a protocol to handle resources for the http client
│   ├── Repositories
│   │   └── ContentRepository.swift -> a class containing all http requests related to movies and series
│   └── Resources
│       └── ContentResource.swift   -> an enum containing all http resources related to movies and series
└── Persistance
    └── Cache.swift               -> a class to handle local data for realm (save, get, search)
  • The Features folder contains the different VIPER modules for the app (content list and detail).
.
├── Content                               -> this module is for the movies/series list
│   ├── ContentInteractor.swift           -> An interactor class to handle data
│   ├── ContentModel.swift                -> A model to be used for the interactor
│   ├── ContentPresenter.swift            -> A presenter class to handle business logic
│   ├── ContentRouter.swift               -> A router class to handle navigation between modules
│   ├── ContentView.swift                 -> A view class to handle UI
│   └── Views
│       └── ContentListItem.swift         -> A view class representing every item of the content list
├── ContentDetail                         -> this module is for the movies/series detail
│   ├── ContentDetailInteractor.swift
│   ├── ContentDetailPresenter.swift
│   ├── ContentDetailRouter.swift
│   └── ContentDetailView.swift
└── MainNavigation
    └── MainNavigation.swift              -> this is a tabbed navigation component (2 tabs for movies/series)


Preguntas

  1. En qué consiste el principio de responsabilidad única? Cuál es su propósito?

RESPUESTA: Consiste en que cada clase o componente de nuestro código tenga un solo objetivo o función. De esta forma cada componente evita tener dependencias a otras funcionalidades que están fuera de su alcance y el código se hace más comprensible y reutilizable para los desarrolladores.

  1. Qué características tiene, según su opinión, un “buen” código o código limpio

RESPUESTA: Para tener un código limpio se necesita tener una arquitectura bien definida y consensuada entre el equipo de desarrollo, luego el código debe ser testeable y si no lo fuera se debe replantear la solución al problema. También es necesario seguir una guia de estilos para estandarizar el código y documentar siempre que fuera necesario los elementos de nuestro código (clases, funciones, parametros, etc..)

You might also like...
Code Challenge - Using Alamofire is a Swift-based, HTTP networking library, also Codable for Data Model and Combine Framework .

Code Challenge ##Using Alamofire is a Swift-based, HTTP networking library, also Codable for Data Model and Combine Framework . Alamofire is one of th

A simple application for watching movies
A simple application for watching movies

A simple application for watching movies

Birthdays App Challenge set by Chalkboard

Chalkboard Birthdays App Challange This is an app that utilises a web api to provide the user an ordered list of birthdays youngest to oldest How to i

Tests Challenge - Finance App
Tests Challenge - Finance App

Tests Challenge - Finance App 💰 No Desafio Testes, temos apenas tarefas de implementação de testes em uma aplicação iOS. Nosso objetivo é implementar

Repository for the first challenge of the SwiftUI Animation Challenges. Create the likeable now playing animation from the Spotify app.
Repository for the first challenge of the SwiftUI Animation Challenges. Create the likeable now playing animation from the Spotify app.

Repository for the first challenge of the SwiftUI Animation Challenges. Create the likeable now playing animation from the Spotify app.

iOS NBA Challenge Based on Xcode 12.4, PR2S Project By: Oscar Pastás

iOS NBA Challenge Based on Xcode 12.4, PR2S Project By: Oscar Pastás iOS This test app consists of a list of users Considerations This test should be

[Accepted] My WWDC21 Swift Student Challenge submission
[Accepted] My WWDC21 Swift Student Challenge submission

My WWDC21 Swift Student Challenge submission I made a playground book that teaches you the basics of ARKit through interactive lessons. It covers posi

WWDC2020 Swift Student Challenge - TheHackOfRayTracing playground book
WWDC2020 Swift Student Challenge - TheHackOfRayTracing playground book

wwdc2021 My wwdc2021 submission The HackOf RayTracing How to run Install swift playground from App Store on your Mac or iPad Double clik TheHackOfRayT

[Accepted] My WWDC2021 Swift Student Challenge submission chosen as one of the 350 winners!
[Accepted] My WWDC2021 Swift Student Challenge submission chosen as one of the 350 winners!

Genetic Algorithms | WWDC21 This project was entirely built with SwiftUI. To direct download this Playground and run it on your Mac or IPad, click he

Owner
Danny Narvaez
Danny Narvaez
Flix is an app the uses the the movies database to get upcoming movies, with infinite scrolling

Flix Flix is an app the uses the the movies database to get upcoming movies, with infinite scrolling Libraries Flix uses Swift Package Manager (SPM),

null 0 Oct 31, 2021
Code Swift iOS app showcasing basic movies list from Orange TV API.

iOS Code Test - Optiva Media Code Swift iOS app showcasing basic movies list from Orange TV API. Built using XCode 13.0 (Swift 5) How to run the examp

Manu Martinez 1 Oct 17, 2021
iOS Tech Challenge - Take Home Challenge

iOS Tech Challenge - Take Home Challenge Thank you for your interest in taking the iOS Tech Challenge. Preparation Please, compile the project in Xcod

null 0 Oct 18, 2021
TakeHomeChallenge - iOS Tech Challenge - Take Home Challenge

iOS Tech Challenge - Take Home Challenge Thank you for your interest in taking t

Michael 0 Feb 1, 2022
Challenge-M2Y-TM4 - A challenge provided by Mobile2You, with the purpose of analyzing knowledge about UI, API consumption

Challenge-M2Y-TM4 Um desafio proporcionado pela Mobile2You, com proposito de ana

Felipe Brigagão de Almeida 0 Jan 31, 2022
Flix is an app that allows users to browse movies from the The Movie Database API.

Flix is an app that allows users to browse movies from the The Movie Database API.

null 1 Apr 5, 2022
An app that allows users to browse movies from the The Movie Database API

Flix Flix is an app that allows users to browse movies from the The Movie Database API. ?? NOTE - PASTE PART 2 SNIPPET HERE: Paste the README template

Akylbek Khamitov 0 Dec 3, 2021
KinoLenta - App for searching movies and creating watchlists based on open movie databases

KinoLenta App for searching movies and creating watchlists based on open movie d

LuckyDmitry 1 Feb 10, 2022
Flix - an app that allows users to browse movies from the The Movie Database API

Flix Flix is an app that allows users to browse movies from the The Movie Database API. Flix Part 2 User Stories REQUIRED (10pts) (5pts) User can tap

Matthew Dong 1 Feb 20, 2022
Starter project for the iOS code challenge

iOS Base Project for Podium Take-Home Challenge Introduction We have provided two version of this base project: one using UIKit, one using SwiftUI. Th

Podium 1 Dec 29, 2021