GithubHelp home page GithubHelp logo

hadanischal / weatherrxswift Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 4.0 22.15 MB

This application is an example to display weather information using MVVM + RxSwift in Swift. It uses the Openweathermap API (http://api.openweathermap.org) as an excuse to have a nice use-case.

Ruby 1.38% Swift 97.98% Shell 0.64%

weatherrxswift's Introduction

WeatherRxSwift for iOS

WeatherRxSwift - Open Source Weather

Requirements:

  • iOS 13.0+
  • Xcode 11.3.1
  • Swift 5.0

Compatibility

This demo is expected to be run using Swift 5.0 and Xcode 11.3.1

Objective:

This is a simple Demo project which aims to display weather information using MVVM pattern in Swift. A fun app made with to demonstrate some examples of clean architecture, SOLID principles code organisation, loose coupling, unit testing and some of the best practices used in modern iOS programming using Swift.

App Goal:

  • This project was intended to work as a weather information demo projects for iOS using Swift.

Implementation:

  • The demo uses the Openweathermap API as an excuse to have a nice use-case, because querying a WebService API is asynchronous by nature and is thus a good example for showing how It can be useful .
  • Use a UITableViewController to display weather information of Sydney, Melbourne and Brisbane as start.
  • Provide a way to add more cities using another modal view controller which includes a search functionality to find a city by name or location.
  • City IDs:
    • Sydney, Melbourne and Brisbane are: 4163971, 2147714, 2174003
  • More city can be found from Bulk Openweathermap API
  • Each cell should display at least two pieces of info: Name of city on the left, temperature on the right.
  • Get real time weather information using Openweathermap current API
  • A sample request to get weather info for one city:
  • http://api.openweathermap.org/data/2.5/weather?id=4163971&units=metri c&APPID=your_registered_API_key
  • Weather should be automatically updated periodically.

Installation

  • Xcode 11.3(required)
  • Clean /DerivedData folder if any
  • Run the pod install pod install
  • Then clean and build the project in Xcode

3rd Party Libraries

  • RxSwift - to make Reactive binding of API call and response
  • SwiftLint - A tool to enforce Swift style and conventions.
  • SwiftGen - swift code generator for your assets, storyboards, Localizable.strings.
  • SwiftRichString - Elegant, easy and swift-like way to create Attributed Strings
  • PKHUD - Swift based reimplementation of the Apple HUD
  • Quick - to unit test as much as possible
  • Nimble - to pair with Quick
  • Cuckoo - Tasty mocking framework for unit tests in swift

TODO:

  • Persist between launches
  • Flexible Design for multiple screen sizes.
  • Improve UI for good user interface, Keep the interface simple.
  • Cover edge case in Unit test
  • Add UI test

Design patterns:

MVVM:

MVVM stands for Model,View,ViewModel in which controllers, views and animations take place in View and Business logics, api calls take place in ViewModel. In fact this layer is interface between model and View and its going to provide data to View as it wants.

Alt text

App Demo

weatherrxswift's People

Contributors

hadanischal avatar

Stargazers

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