Giter Site home page Giter Site logo

swift-mvvm's Introduction

Swift MVVM

A Swift Example of ISL's MVVM Technique

💰 Installation

  1. Create an account or grab a new API key from Dark Sky API
  2. Make sure CocoaPods is installed and up to date. Run pod install in the project directory.
  3. At the root of the repo find the keys_template.plst file. Copy or rename to keys.plist.
  4. Open swift-mvvm.workspace and drag the keys.plist into the project and add to target. Open the file an put your API Key in the plist under apiKey.
  5. Build and run!

⛽️ Dependecies

To minimize code and highlight the MVVM structure, two dependencies were used to make network calls easier.

  • Alamofire
  • SwiftyJSON

📱 Project Overview

  • NetworkManager.swift - Handles the GET Request to Dark Sky's API.
  • WeatherData.swift - Data model with the information we want to show in the app.
  • WeatherViewModel.swift - Takes in WeatherData and formats the data to be displayed in the views.
  • WeatherTableViewCell.swift - Updates the view from the view model.
  • Utilities.swift - Converts the payload into an array of WeatherData.

swift-mvvm's People

Contributors

mehdihasan avatar tguidon avatar

Watchers

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