Giter Club home page Giter Club logo

marvel's Introduction

Marvel - Mobile Exercise

This is a iOS app created using Swift and the Marvel Developer API. You can search and save the chracteres you like most.

This is a video demonstration at Youtube! :D

Requirements

  • Xcode 10.2
  • iOS 11.0 +
  • Swift 5

Architecture

This app is using MVVM, with Interactor (Called Logic in this project) and Routers, taking advantage of Coordinators on navigate between screens. All the UIKit stuff are only at Coordinators and UIViewControllers. The app's core do not rely on UIKit.

The data flow starts from the user interface on the screen to the ViewModel then to the Logic class and then to the router's class when we need to go to another screen. The service layer is injected into the Logic, so it's easy to replace network calls with mocked jsons.

Example:

class CharacterCatalogLogic {
//...
    convenience init(router: CharacterCatalogRouterable?) {
        if isLaunchedWith(LaunchArguments.mockNetworkResponses) {
            self.init(service: MVLHeroesMockService.shared, router: router)
        } else {
            self.init(service: MarvelAPI.shared.characterService, router: router)
        }
    }
//...
}

Features

  • No Storyboard: View develop ~80% in code using PureLayout, with no broken contraints. Cell and custom views are created using XIBs.
  • Unit Tests: 6
  • UITests: 6
  • Devices: iPhone5 and 5s, iPhone6 and 6s, iPhone7.
  • iOS: 11.0+.

🌟 💯 All tests passed using above configurations. 🌟

This project takes advantage of Protocols and Generics to reuse views and cells. Using this swift features we avoid typos when using reuseIdentifiers.

On Swift 5 I can use Result type to handle network responses better.

You can favorite a character right from the catalog screen, just do a long press over any item and the options to that character will show up.

Pods

pod 'PureLayout'

Less verbose Auto-Layout constraints: myView.autoPinEdgesToSuperviewEdges().

pod 'CCBottomRefreshControl'

Add a activity indicator at the bottom of UIScrollView (UITableView, UICollectionView). Because ANGTFT, I'm kidding, I have a lib that do that but its not on swift 5 yet and I had no time to implement it again at this moment.

How to install

  • Clone or download the project to your machine.
  • At the project directory run: bundle install and then bundle exec pod install.
  • Open XCode10 and build the project using: Cmd+ Shift + B.
  • Build the project for testing using: Cmd+ Shift+ U.
  • Run the tests using: Cmd + U

A wild build for test error appeared!!!

The build for test process may fail because the 'pod UITestHelper' has it property enable_bitcode = YES simply change it to NO and build for test again using Cmd+ Shift+ U.

marvel's People

Contributors

felipecardoso89 avatar

Stargazers

Amer Eid avatar Mohamed Abdul-Raouf avatar Pamela Ianovalli avatar Sergio Sánchez Sánchez avatar

Watchers

James Cloos avatar  avatar

Forkers

sahilramteke

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.