Git Product home page Git Product logo

zemoga-mobile-test's Introduction

Swift Version

Zemoga iOS Mobile Test

This app was designed and built around Uncle Bob's Clean Code and Clean Architecture Paradigm, here the VIPER(View Interactor Presenter Entity Router) Pattern. Isolate responsabilties allowing us to have different data sources and entities, modify them or extend them without modifiying the logic or UI layer of the app. There's place for refactoring but for the purpuse of this test and the time frame I decided to keep it simple and understandable

The main Modules are PostsListModule and PostDetailModule which contain the logic, ui and data communication layers for each module. Then we have entities which are the models such as Post, User and Comment. The DataModel is a class that contain the methods to retrieve the data from the different sources or entities and provide to the presenter and interactor. This easily could be the data layer gateway. If we needed to separate the data logic for each module we could easily do so with this project architecture. There's always place for improvement and having the responsability of each component of the VIPER architecture makes the project sustainable and easy to debug.

For caching the posts I decided to go with file storage in JSON format, as the data is publicly available there are no security corncerns, nontheless the file is stored under the .userDomainMask, it has the same structure of the response from the API so the entities could code and decode the data easily.

The only third-party library is Refreshable, is a SwiftUI Component Extension that was introduced natively in iOS 15.0 but ist not available in iOS 14.0. It's used for the pull down to refresh feature.

Unit Testing should follow the best practices starting for the acronym FIRST, fast, independent, repeatable, self-validating, timely. In this project we are using Combine which is a "Customize handling of asynchronous events by combining event-processing operators." which further helps with the Clean Architecture Proposed by the VIPER Pattern.

To unit test Combine it was necessary to create an extension, in order to wait for the data to be asynchronously retrieved. For the time I had and nature of the project I've only added a test for loading the default post.

The UI is simple and tries to follow the apple native design guidelines but it might lack of UX.

Features

  • Local Posts are loaded first, to load post from the API drag the screen down
  • Load post, post details, user and comments from JSONPlaceHolder
  • Cache List of Posts
  • Delete Individual Post
  • Delete All Post (including favorites)
  • Favorite Post are sorted to the top or display on individual "favorites tab"

Requirements

  • iOS 14.0+
  • Xcode 13.3.1

Installation

Basic Installation

  1. Clone
  2. Run on Physical Device or Simulator iOS 14.0+

Meta

Alejandro Arciniegas โ€“ @alejandroarciniegas.dev โ€“ [email protected]

zemoga-mobile-test's People

Contributors

alejandroarciniegas 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.