TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2015 |
SPMSupports SPM | ✗ |
Maintained by Raul Riera.
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.
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.
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.
Looking for a Swift 1.2 version? Try the swift-1.2
branch.
Raul Riera, @raulriera
Carlos Yllobre @charlieyllobre