ForecastView 0.3.1

ForecastView 0.3.1

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2015年9月
SPM支持SPM

Raul Riera维护。




ForecastView

使用

使用自定义视图非常简单,以下代码从Storyboard中获取库实例,并使用来自Wunderground.com的数据源获取城市Valencia, Venezuela(纬度10.162,经度-68.0077)的天气预报

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)
    }

}

Carlos Yllobre创建的精美图标集合包含在Example项目中。

扩展

如果您想使用其他数据源,只需创建一个实现ForecastDatasource协议的类。就这么简单。

想使用您自己的图标?在Conditions模型中提供图标文件名。有关更多信息,请查看ConditionsView

安装

手动

安装此框架最简单的方法是将ForecastView/ForecastView文件夹拖放到您的项目中。这还可以防止iOS中frameworks问题,其中IBInspectable和IBDesignable被删除。

Swift 1.2

正在寻找Swift 1.2版本?尝试swift-1.2 分支

创建者

Raul Riera, @raulriera
Carlos Yllobre @charlieyllobre