Git Product home page Git Product logo

hi-weather's Introduction

Hi Weather

Hi Weather! is a basic weather app built to practice modularizing a codebase and practice using collection views.

Improvements

  • The app is set up for testability, but I would like to write more robust tests around the ViewModels and Frameworks.
  • Creating a more generic base class for UICollectionViewCell types to inherit from would be nice, as most of them currently implement similar behavior with the same method names.
  • Implement CoreLocation to automatically detect the users location.
  • Find a way to break my Models out of the Networking framework, or just considering a new approach for this in general. Currently, I am needing to import WeatherService purely to access models. I'd like to not import WeatherService, and find a different way to share the models. This could look like another framework, or even a translation layer for what type is returned from the AppState (possibly a new model specific to the App as opposed to response related).

Architecture

Hi Weather! uses the MVVM+Coordinator pattern along with an AppState object to control different states throughout the app.

Coordinators

Coordinators are responsible for managing app flow and screen presentation. Using the Coordinator pattern allows app flows to be decoupled from views and have the flexibility to present different flows to a user, easily.

MVVM

Model-View-ViewModel is used in this app to promote seperation of concerns. ViewModels will be injected with state that will be bound to the corresponding View to automatically update. Using this architecture cleanly seperates logic as well as providing the opportunity to easily test logic outside of the View context. This allows the views to be "dumb" and only display the state/data they should be in.

App State

AppState is a single source of truth for all things App State related. Currently the app is so small it is hard to see the benefit of implementing this framework. However, once needed it can provide a lot of flexibility for sharing different state across multiple areas of the app. It also decouples the Main App from Networking, and offloads that for AppState to trigger certain requests. All the main app needs to do is ask AppState for new information, or for what State it should be in, and the corresponding View will reflect that.

hi-weather's People

Contributors

jjonesdev avatar

Watchers

 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.