This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
073c04c
commit 5674990
Showing
10 changed files
with
147 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,49 @@ | ||
# MetobsKit | ||
|
||
A description of this package. | ||
This package is a wrapper for the PMP3g API provided by [SMHI](https://smhi.se). | ||
|
||
|
||
### Usage | ||
|
||
Note that this is just a simple example demonstrating how the package can be used. | ||
|
||
```swift | ||
/// Get an instance of the weather forecast service | ||
let service = ForecastService.shared | ||
|
||
/// Request the current weather forecast for Stockholm | ||
service.get(latitude: 59.3258414, longitude: 17.7018733) | ||
.observe { result in | ||
switch result { | ||
case let .value(observation): | ||
/// Use the current forecast | ||
guard let forecast = observation.current else { | ||
return | ||
} | ||
|
||
/// Get the air temperature | ||
let temperature = forecast.get(parameter: .airTemperature) | ||
|
||
/// Use the air temperature in some way | ||
case let .error(error): | ||
/// This error should be handled in a real use-case | ||
fatalError("Failed to get forecast!") | ||
} | ||
} | ||
``` | ||
|
||
### Attribution | ||
|
||
This package utilizes data provided by [SMHI](https://smhi.se). | ||
|
||
### Terms of use | ||
|
||
Make sure to read SMHI:s [terms of use](https://www.smhi.se/data/oppna-data/villkor-for-anvandning) before using this package. | ||
|
||
### Legal disclaimer | ||
|
||
The developer and this package are not affiliated with or endorsed by SMHI. Any products and services provided through this package are not supported or warrantied by SMHI. | ||
|
||
### License | ||
|
||
See LICENSE for license details concerning this package and SMHI:s [terms of use](https://www.smhi.se/data/oppna-data/villkor-for-anvandning) for license details concerning the data provided by their API. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters