Giter Site home page Giter Site logo

crypticgecko's Introduction

CrypticGecko

Description

A self-educational iOS app to track coin prices.

APIs

https://www.coingecko.com/en/api

Frameworks

Swift - SwiftUI - Combine -> ...

Instructions

  1. Customised color themes and app icon were added to the Assets of the project.
  2. A reusable button was created to be used for the header of the home screen.
  3. MVVM files of "Home" screen were added to the project. //Add the prior steps

Services

  1. CoinDataService:
  2. CoinImageService: To firstly download and save images in Filemanager and afterwards to retrieve the saved images.

Networking Layers:

  1. NetworkingManager in Utilities
  2. DataService in Services
  3. ViewModel

Networking Architecture:

To keep the app and its services reusable, I have used 3 layers: 1st Service, which is responsible for downloading from internet and after returning the data, appends the data to a published property. 2nd ViewModel, which is responsible for subscribing to the data appended to the published property of the Service. 3rd View, which is responsible for referencing to the ViewModel and at the end put the recevied data on screen.

Utility classes:

  1. NetworkingManager: This utility class consists of 3 static methods of download, handleCompletion and handleResponse. Plus an NetworkingError enum. Being static func allows us to simply call like NetworkingManager.download every where in our app.

  2. LocalFileManager: This utility class is used to SAVE images instead of redownloading them again and again. Therefore, the 2 main funcs inside of this class will be saveImages to the fileManger and getImages back from the fileManager. Moreover, we will have 3 more funcs: getURLForFolder, getURLForImage, createFolderIfNeeded.

Search & Filter by Combine:

The searchText published var in HomeViewModel will be binded to SearchBarView. Therefore, whenever we type something in the searchBar, this published var will be updated. Hence, if we subscribe to this publisher, we can use its value.

We wanted to combine $searchText and $allCoins publishers and map them to a new array CoinsModel and also filter them.

Models:

So far 2 models have been used:

  1. CoinsModel: which consists of ALL data related to the coins, coming from the URL.
  2. StatisticModel: which consists of selected data related to the coins which then will be needed to create the HomeStatView.

CoreData:

Saving data, like downloading data, needs a Service class. The difference will be that, in downloading the end point is a URL but in Saving, it will be coreData of the currentPortfolio in this specific case. Before we start working with CoreData, we need to setup a coreData Entity, that we will be storing in CoreData. For organizing purposes, remember to save the entity file in Model folder as it's really a model.

Architecture of Models:

  1. Create a model file in model folder which consists of the desired properties.
  2. Make a view in component folder which consists of a reusable view with all the necessary data in that view.
  3. Make another view in its appropriate folder like Home. This one should consists of the final look of our desire view.
  4. Transfer all NOT view related data to a ViewModel.
  5. Finally call the View of 3rd step inside the final View of the app.

TODO

Add UnitTests for all the VMs Add UITests for all the Views Make a separated repo out of LocalFileManager.

On 05.09:

  • Save the holdings on coreData

crypticgecko's People

Contributors

maz-kar avatar

Watchers

 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.