Merge pull request #5 from bourvill/release/2.2.0 Release/2.2.0
Merge pull request #5 from bourvill/release/2.2.0
Release/2.2.0
OpenWeatherKit is a library written in Swift.
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
CocoaPods 1.3.1+ is required to build OpenWeatherKit.
To integrate OpenWeatherKit into your Xcode project using CocoaPods, specify it in your Podfile:
Podfile
pod 'OpenWeatherKit'
Then, run the following command:
$ pod install
[] Weather [X] Latitude Longitude [X] OpenWeatheMap City id [] ForeCast [X] Latitude Longitude [X] OpenWeatheMap City id
First:
import OpenWeatherKit
In your view controller’s
let weatherApi = WeatherApi(key: "YOUR_OPEN_WEATHER_API_KEY") weatherApi.getWeatherFor(lat: "5.567788", lon: "1.5544") { result in switch result { case .success(let weather): self.cityLabel.text = weather.name self.tempLabel.text = "\(weather.main.temp)" case .error(_): //Do something break } }
OpenWeatherKit is released under the MIT license.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
OpenWeatherKit
OpenWeatherKit is a library written in Swift.
Requirements
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
To integrate OpenWeatherKit into your Xcode project using CocoaPods, specify it in your
Podfile
:Then, run the following command:
Usage
Method available
Code Implementation
First:
In your view controller’s
License
OpenWeatherKit is released under the MIT license.