Giter Club home page Giter Club logo

marvel-heroes's Introduction

BuddyBuild Swift Xcode

Marvel Heroes iOS App

This App fetches characters from the Marvel Comics public API. It also allows to search for more characters remotely via REST calls. Characters can be selected to see their details and a list of comics where they appear.

Goal of this project

Explore the possibilities of different App architectures to achieve:

  • Clean, maintainable and testable code
  • Modularity: Any part of the system can be changed without affecting the rest
  • Add new features easily

##Architecture Using the façade design pattern: provides a single interface to a more complex subsystem. Instead of exposing the user to a set of classes and their APIs, you only expose one simple unified API There is central class where all the objects request data. It's an interface that holds:

  • Networking
  • JSON Parser
  • Object serializer
  • Persistency manager

In each branch there is a different implementation, from more simple to more advanced.

Branches (from older to newer)

  • XCode 731_Haneke+SwiftyJSON: Uses Swift 2.2 + Cocoapods external libraries for image caching and JSON Parsing. MVC Pattern.
  • MVC: Swift 3 + no dependencies (custom implementation) + MVC Pattern.
  • MVVM: Swift 3 + without dependencies. MVVM Pattern.

There are 3 Use Cases or Scenes, divided in ViewControllers:

##Browse a list of Characters (Master VC):

  • Holds a CollectionView which is compatible with iPhone/iPad
  • Contains the suggestions VC
  • There is an infinite scroll to load more items (batches of 20)

##Search other characters remotely (Suggestions VC):

  • Is created programmatically
  • Holds a table view to show results from the remote server API calls
  • Sends requests against the REST API for user entered text

##View information about a Hero (Hero Detail VC):

  • Holds information about the Characters inside a scroll view
  • Has a collection View with comics from that Character

##UI Sketch file is provided with the assets that were used.

  • Custom icon
  • Custom fonts
  • Custom buttons

#Testing

  • There are some unit tests that check the apiClient
  • In final product a lot more tests should be tested. But it's out of scope here.

##Documentation Documentation can be found in Marvel Heroes/Docs Look for 'Docs' folder for generated HTML files in Apple Documentation style.

To generate docs again, first install jazzy

sudo gem install jazzy

and from the same folder where this README.md file is run:

$ jazzy --min-acl private

##Considerations Didn't chose CORE DATA as the persistency. The reason is that the Marvel service has less than 1.5k character records and for simplicity JSON files are enough. The data is unlikely to change, so we save it in a NSCache.

Marvel character API doesn't offer a lot of information. Only name, description (most of them are empty), modification date and Id. There is a wiki page for each character. This page has more information, but it would require web scrapping, also it is out of the scope of this project. We could add a webView and load the html of the wiki.

In the Hero Detail page we are showing Comics, but we could also show Stories, Events and Series the same way. But would be repeating the same calls to the server requesting different entities.

marvel-heroes's People

Contributors

ktmarc avatar

Watchers

James Cloos avatar  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.