Skip to content

JanC/AVWXKit

Repository files navigation

AVWXKit

Swift Version License Carthage compatiblePlatform

AVWXKit is a swift client for the METAR/TAF avwx.rest service.

Requirements

  • iOS 11.0+
  • Xcode 9.0

Installation

CocoaPods

You can use CocoaPods to install AVWXKit by adding it to your Podfile:

platform :ios, '11.0'
use_frameworks!
pod 'AVWXKit'

Carthage

Create a Cartfile that lists the framework and run carthage update. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/AVWXKit.framework to an iOS project.

github "JanC/AVWXKit"

Manually

  1. Download and drop AVWXKit.swift in your project.
  2. Congratulations!

Usage example

import AVWXKit

// Token from https://account.avwx.rest/
let client = AVWXClient(token: "xxxxx")

// By ICAO
client.fetchMetar(at: "KSBP", options: [.speech, .info]) { result in
    switch result {
    case .success(let metar):
        print("Metar: \(metar.rawReport)")
    case .failure(let error):
        print("Could not fetch: \(error)")
    }
}

// By Coordinates
let coordinates = CLLocationCoordinate2D(latitude: 35.237, longitude: -120.644)
client.fetchMetar(at: coordinates, options: [.info, .speech]) { (result) in
    switch result {
    case .success(let metar):
        print("Metar: \(metar.rawReport)")
    case .failure(let error):
        print("Could not fetch: \(error)")
    }
}

Contribute

We would love you for the contribution to AVWXKit, check the LICENSE file for more info.

Meta

Jan Chaloupecky – @TexTwil

Distributed under the XYZ license. See LICENSE for more information.

Releases

No releases published

Packages

No packages published