Introduction

Xweather iOS SDK

The Xweather iOS SDK allows a developer to quickly and easily add weather content and functionality to their iOS and tvOS applications quickly and easily without having to code anything themselves. It utilizes the Xweather Weather API backend for data loading and is built on top of an object mapping system that efficiently loads requested weather content into third-party iOS and tvOS applications, greatly reducing the amount of code and development needed on the developer end.

Once you have our SDK setup in your own project by following our installation guide, getting data into your applications is quick and easy. For example, loading the current conditions for a particular place is as simple as the following sample code demonstrates:

let place = AWFPlace(city: "seattle", state: "wa", country: "us")
AWFObservations.sharedService().get(forPlace: place, options: nil) { (result) in
    guard let results = result?.results else { print("Observation data failed to load - \(String(describing: result?.error))"); return }
 
    if let obs = results.first as? AWFObservation {
        // do something with obs...
    }
}

You can learn more about the various ways to load Xweather Weather API data into your application by reviewing our Getting Started guide. Also, make sure to check out how you can add a fully-functional weather map powered by Xweather Raster Maps or graph various weather data from our API.

Be sure to review our complete demo application (opens in a new tab) for extensive SDK usage examples and code and our selection of quick code examples under the "Examples" sidebar navigation item.