Giter Club home page Giter Club logo

ioscodingchallenge's Introduction

Polestar iOS Technical assessment

Utilising the OpenLibrary API, please produce a simple book search engine that shows the top 10 book results for a given search term.

Features

  • Landing Page with Search functionality
  • Search Result Page with Loading and Empty States
  • Local (coredata) And Remote Data Store - Fetch, store and retrieve data to and from disk
  • Basic Input validation implementation
  • Strings Localisation

To-Dos

The following list contains features that were not included in the challenge requirements, and as such I left them given time constraints, but would definitely be something to consider for real world scenario.

  • Unit tests
  • Snapshot tests
  • Complete API documentation
  • Local Store error handling
  • General UI/UX Improvements.
  • Improve Validation by creating Validator object, rules enum and set of specific errors. NOTE: By reading the challenge I initially (and probably mistakenly) had feeling two screens were required. But ideally I would want to do the same challenge in only one screen. The Landing page with following elements:
  • UISearchBar on top
  • Message inviting user to search in middle of the screen
  • UITableView to display search results
  • Empty view, Error View replacing the list when needed. Nice to have would be a search autocompletion (although that's off the requirements :())

Requirements

  • Please create a landing page where you can input the search term i.e. "Lord of the rings".
  • On clicking an OK button, the app will show the top 10 books (title, cover, author, year etc.) for that search.
  • We will leave the UI design of the app to the applicant but keep it simple as we do not expect our developers to be graphic designers too.
  • We expect to see some examples of error handling and input validation.
  • We would like the UI to be written with UIKit.

Optional Requirements:

  • Store the API output in a local sqlite database
  • For the searches, search the local database first and then hit the API in case of no result

Architecture

I have used uni-directional VIP architecture. The three main components of VIP are the view controller, interactor and presenter. They act as input and output to one another, as shown in the following diagram. 10-650x459

A few of the advantages are below:

  • Follows SOLID principles
  • Data flows in one direction making it easier to debug
  • Testing becomes more straightforward as all the components abstract protocols and keep a reference to each other via protocol, which makes it easy to mock them while testing.
  • The Router handles all the navigation-related code.

Inception

I tried to stick to requirements as much as possible keeping time constraints always in mind. After reading the assignment I sketched down on paper the app flow I had in mind:

  • A landing page with a search input field and an 'ok' button.
  • A page displaying the top 10 results (including some edge case view i.e. empty-no data) After, I tried to break down (still on paper) the work in individual tasks, thinking it would help me to create a cleaner commit history. I knew I would want to utilise the VIP Architecture as its very lightweight and it would suffice in this circumstance. Soon after that I started building the project: boilerplate code, modules infrastructure, UI, networking, storage etc.. As a final step reviewed the code and removed, cleaned/changed unnecessary code.

Screenshots

Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 09 11 26 Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 10 16 48 Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 09 14 53 Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 09 14 40 Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 10 17 46 Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 10 18 26

Meta

Syed Ali Kashan

swift-url

license-image

ioscodingchallenge's People

Contributors

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