GithubHelp home page GithubHelp logo

buubui / forecastview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raulriera/forecastview

0.0 2.0 0.0 301 KB

Extensible View subclass that displays the weather forecast of a given CLLocationCoordinate2D. Written in Swift ❤️

License: MIT License

Ruby 17.48% Swift 80.99% Objective-C 1.52%

forecastview's Introduction

ForecastView

Usage

Using the custom view is straightforward, the following code gets the instance of the library from a Storyboard and proceeds to use the Wunderground.com datasource to fetch the weather forecast for the city Valencia, Venezuela (10.162 latitude and -68.0077 longitude)

import UIKit
import CoreLocation
import ForecastView

class ViewController: UIViewController {

    @IBOutlet weak var forecastView: ForecastView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Init the Forecast View
        forecastView.datasource = WundergroundDatasource(apiKey: "YOUR-API-KEY-FROM-WUNDERGROUND.COM")
        forecastView.coordinates = CLLocationCoordinate2DMake(10.162, -68.0077)
    }

}

A beautiful icon set created by Carlos Yllobre is bundled with the Example project.

Extending

If you wish to use other datasources, just create a class that implements the ForecastDatasource protocol. It's that easy.

Want to use your own icons? Supply the icon filename in the Conditions model. Checkout the ConditionsView for more information about this.

Installation

Manual

The easiest way to install this framework is to drag and drop the ForecastView/ForecastView folder into your project. This also prevents the frameworks problem in iOS where the IBInspectable and IBDesignable are stripped out.

CocoaPods

Add the following to your Podfile:

use_frameworks!
pod "ForecastView"

Carthage

Add the following to your Cartfile:

github "raulriera/ForecastView"

Swift 1.2

Looking for a Swift 1.2 version? Try the swift-1.2 branch.

Created by

Raul Riera, @raulriera
Carlos Yllobre @charlieyllobre

forecastview's People

Contributors

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