Challenge app for Moises.ai iOS Developer position

Related tags

Testing CSGOApp
Overview

CSGOTV

Description

Challenge app for Moises.ai iOS Developer position For this challenge you have to implement an app to display all CS:GO matches in a time period range using PandaScore API as backend api source. Figma design for reference

Installation

System Requirements

This implementation was made on a M1 Mac and tested on a Intel based mac, so I guess it is working fine in both platforms it runs fine in both of my macs I used XCode 13.4.1 running on MacOS Monterey 12.5

To be able properly open CSGOTV.xcworkspace, you have to first:

pod install

If something gets wrong just do a pod deintegrate and then pod install again. Hope it works

About Implementation

CSTVGONetworking

This is the Networking API module, it was designed to be detached from the main CSTVGO app, and can be used as framework for any other app that needs these api calls/models. Nothing much to say about it, you can read the methods documentation in the code, It's not the most beautiful peace of code you ever saw in your life, but it's working.

Architecture

Basically, I don't have much to say about the architecture, because one of the requirements was to do it using MVVM.

Coordinators and Factory

So I decided to use Coordinators to do flow management, and factory pattern to instantiate the section classes. Basically one Coordinator is responsible for communicate with others coordinators and push the view using the viewController returned by the factory. The coordinator will not have access to viewModels, services and other stuffs, it can only see the factory. BUT, we still need to call other views/coordinators, so for that, the viewModel can have a instance of a coordinatorDelegate to delegate some external view/coordinator call to the section coordinator.

ViewControllers

Talking about ViewControllers, it does have a ViewModel reference to directly call methods and get data from. ViewModels doesn't have direct references to ViewControllers, so to pass any kind of information to ViewControllers I used state Publishers, were I listen to it in the ViewController.

ViewModel

The ViewModel is responsible to fetch the data from the service, sort and format to send it beautifully for the ViewController to display. Many people love "pure" ViewModels and like to manipulate the data in managers. I not a big fan of this approach but I'm using a manager to format tournament data indeed

Service

Well, service is a service. It calls the CSGOTVNetworking session implementation to get the data from PandaScoreAPI. I wrote a little documentation in the code, if you have any question, feel free to contact me.

Views

To enable programmatically view code, I created a ViewCode protocol to handle hierarchy, constraints and further setup for views. It can be used in any kind of View, from ViewControllers to TableViewCell. All views have their elements lazily created, and some of them have one method to setup the elements.

External Dependencies

I'm only using Kingfisher to download images using the url directly into imageViews. Although I could use Alamofire for backend calls, or SnapKit for programmatically create constraints, for this project scope (not a huge app, not that hard to maintain) I decided to do it all by hand.

Problems Found

PandaScore API

God, never heard about before. But I think it works fine to create IA models and manipulate the data. If you need LOADS of data, this is what you are looking for. But, to do a simple app to show matches, it is not that good. One of the problems that I found was that I would have to pay a big amount of money IN EUROS to get a specific match information. To workaround that, I saw that I was able to get the tournaments list with all the matches. Cool, problem solved, right? right? Not at all. Some tournaments have a TON of matches. Thats why I get only 5 tournaments and end up with 35-40 matches. The solution is get only one tournament per page, right? Buzz sound Wrong again. Even asking for sorted tournaments with begin_at attribute, some matches start in different days, which causes a big mess when doing pagination and updating the matches table view. Yep, the best solution I found was to get 5 tournaments, parse the data, display and scroll a lot to see the pagination. You will see that the data still gets messed up not a bug, more like a feature. If this was a real world scenario, I would definitely have a conversation with the backend team!

UITests Failing

Sometimes UITests fails. Not completely sure why, but it does. looks like a feature, or a xcode bug, not really sure

Improvements

  • Definitely enhance UITests and UnitTests. They are not the way I wanted to be
  • Create a UIModule to common UI classes
  • I don't liked that much the way PandaScore handles the data. I Would create a backend microservice to get data from PandaScore, parse it and send back to the mobile. With this approach it's easier to even create an Android version.
  • SwiftUI (I'm working on having all SwiftUI skills)
You might also like...
Basic (simple) App for MacOS with simple functionality
Basic (simple) App for MacOS with simple functionality

Test Mac App Basic (simple) App for MacOS with simple functionality General Details Build : 1.0 Author Alias : gonewithharshwinds Brand : ADV Descript

Bank-Test - MVVM List-Details App using combine

Bank-Test MVVM List-Details App using combine Pods used in this Task Moya with A

Marvel-heroes - Marvel Heroes App Built with Swift
Marvel-heroes - Marvel Heroes App Built with Swift

Marvel Heroes Marvel Heroes repository based on Marvel API https://developer.mar

Marvel - Marvel Characters App using MVVM, and including unit tests
Marvel - Marvel Characters App using MVVM, and including unit tests

Marvel About The purpose of this project is to develop a app using MVVM, and inc

PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture.
PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture.

PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture. F

Snapshot testing tool for iOS and tvOS
Snapshot testing tool for iOS and tvOS

SnapshotTest is a simple view testing tool written completely in Swift to aid with development for Apple platforms. It's like unit testing for views.

ShortWebCore - This iOS library lets you run automations on Web Views.

This iOS library lets you run automations on Web Views. Example (Optional) Declare class conforming to AutomationRunnerDelegate: import S

Swift Package with examples of how to tests iOS apps

GimmeTheCodeTDD A swift package with examples of unit tests in iOS development. Requirements Xcode 13 Content Dependency Injection Constructor Injecti

Library for unifying the approach to network mocking in iOS unit- & UI-tests.

TinkoffMockStrapping Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installati

Owner
Luzenildo Junior
Senior iOS Engineer
Luzenildo Junior
This is the main repo for the coding challenge for the FoxBox iOS devs.

Code Challenge Given an already existing response from a MovieDatabase API Call: Fill the movies property with the (almost) parsed response. Create a

null 1 Mar 25, 2022
Implementing and testing In-App Purchases with StoreKit2 in Xcode 13, Swift 5.5 and iOS 15.

StoreHelper Demo Implementing and testing In-App Purchases with StoreKit2 in Xcode 13, Swift 5.5, iOS 15. See also In-App Purchases with Xcode 12 and

Russell Archer 192 Dec 17, 2022
Tapper - simple app for iOS and iPadOS allows a user to tap a button as many times as possible in 20 seconds

Tapper Table of Contents Description Screenshots Installation Usage Code Contact

Geoff Johnson 0 Mar 12, 2022
Mooviely - Mooviely Basic App for IOS Test

Mooviely Mooviely Basic App for IOS Test. Anasayfa Bu sayfa açıldığında ekranın

null 0 Feb 13, 2022
View your app on different device and font sizes

Sizes reduces the time it takes to evaluate all of our apps possible device sizes, orientations and font combinations. With Sizes we'll avoid launchin

Marcos Griselli 1.2k Oct 27, 2022
Fastbot is a model-based testing tool for modeling GUI transitions to discover app stability problems

Fastbot is a model-based testing tool for modeling GUI transitions to discover app stability problems. It combines machine learning and reinforcement learning techniques to assist discovery in a more intelligent way.

Bytedance Inc. 446 Dec 29, 2022
This is a simple test app getting data from network to practice a tad bit.

test This is a simple test app getting data from network to practice a tad bit. Start Nothing fancy, no CocoaPods, just clone and run! Architecture Ju

null 1 Oct 9, 2021
This repo holds the code for Dubizzle & Bayut test App

DubizzleClassified This repo holds the code for Dubizzle & Bayut test App About App This is a simple app which basically fetches item list from the gi

Ghassan 0 Jun 2, 2022
Fake iPhone real devices location using this small app

Project Title iPhone IP Spoofer for Real Devices. Description IP, or internet protocol, is a string of numbers that identifies your iPhone, iPad, or w

Ebahim Mostafa 4 Sep 20, 2022
Switchboard - easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.

Switchboard - easy A/B testing for your mobile app What it does Switchboard is a simple way to remote control your mobile application even after you'v

Keepsafe 287 Nov 19, 2022