Code Monkey home page Code Monkey logo

jldishwashers's Introduction

Dishwashers

Technical test for John Lewis by Iain McLean.

Requirements

  • Xcode 8.2.1/iOS 10.2 SDK
  • Cocoapods 1.1.1 or later

Building

  1. Clone the project
  2. Install cocoapods with Administrator privileges using sudo gem install cocoapods
  3. Open a terminal and issue the following command within the top level project directory: pod install
  4. Open the Xcode workspace file and build in the normal way

I chose Cocoapods as a dependency manager purely because:

  • It still has more support than Carthage, although personally I believe Carthage has more legs in the long run
  • It separates out libraries before compile time from the main project

Solution Notes

I focussed on initial test-driven implementation of the main product grid screen however this requires a more in depth testing scenario due to the VIPER stack used.

The product detail screen is not complete for content but layout is handled for orientation using traits and size classes. I have used a traits trick to make the iPad think it is in another size when it is indeed not to layout the screen for landscape orientation.

Architecture

The app uses the VIPER architecture with concrete class instantiation for the up-flow and protocol orientation for the down-flow, this helps move away from the massive-view-controller issue but more importantly, it helps decouple the code into more manageable and understandable stack elements.

MVVM and MVC were considered, but I am a fan of VIPER and prefer to keep things clean and readable.

Unit Testing

With less than 24 hours spent on this test, I concentrated in preparing tests for the VIPER stack to show the use of Unit testing in XCode.

Credits & Libraries Used

  • AlamofireImageView - by the Alamofire Software Foundation; a library written in Swift which makes working with images in a network environment much simpler and cleaner. I chose to use this because:

  • It reduces code volume and improves simplicity for populating a grid of UIImageView objects.

  • KVNProgress - a fork of the implementation by AssistoLab, forked to add some extra functionality

  • A simple and easy to use display HUD, used purely here for user feedback

Areas for Improvement

  • Use of Alamofire for Networking to reduce code volume, it is almost an industry standard now but I wanted to show the use of standard iOS Networking in this case.
  • Use of Reachability to monitor Network online status, which ultimately would help in providing better user feedback.
  • Unit testing improvements - Mocks, Spy's (and a lot more of them) and all the good things that come with proper TDD practices.
  • UITests
  • Fastlane, Fabric, BranchIO etc for analytics, crash management etc

jldishwashers's People

Contributors

imclean avatar

Watchers

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