Installation

Installation

The Xweather iOS SDK is built using Apple's XCFramework (opens in a new tab) format, which means that multiple platforms are supported for each of our frameworks.

Setting up

To get started with the Xweather iOS SDK/tvOS, you'll need to integrate the SDK into an existing project.

The Xweather iOS SDK/tvOS has the following requirements:

  • Xcode 11 or later
  • iOS 10 or later
  • tvOS 10 or later
  • macOS 10.15 or later (via Mac Catalyst)

You can review the demo application (opens in a new tab) that already has the SDK integrated with sample code and views.

Including the SDK in a project

There are several ways you can integrate the iOS SDK with your own existing project. Select one of the above methods to integrate the SDK based on your preferred method, but don't use more than one method as that will result in duplicate copies of the SDK and compiler errors.

CocoaPods

  1. Make sure you have CocoaPods installed and working. If you don't have CocoaPods installed on your system, follow the installation instructions (opens in a new tab) to get started. If you're new to or unfamiliar with CocoaPods, also make sure to review its usage guide (opens in a new tab) to learn more about how to get started with CocoaPods for your project.

  2. Add the Xweather pod to your Podfile. This will add the base AerisWeatherKit.framework and its core dependencies to your project.

    pod 'Xweather'
  3. If you want to also use any of the weather mapping functionality available in our iOS SDK, you'll need to also include the Maps pod:

    pod 'AerisWeather/Maps'
    
    # include this if using Mapbox for maps in your project
    pod 'AerisWeather/Mapbox'
    
    # or include this if using Google Maps for maps in your project
    pod 'AerisWeather/GoogleMaps'
  4. Run pod install from the Terminal at the root of your project where your Podfile is located.

  5. Open your *.xcworkspace file with Xcode. Do NOT use *.xcodeproj as you'll receive ld: library not found errors for the Xweather libraries.

  6. Under the Build Phases tab of your Target, click the + button on the top-left and select New Run Script Phase. Setup the build phase as follows, and make sure this phase is below the Embed Frameworks phase:

    Shell /bin/sh
    
    bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/AerisCore.framework/strip-frameworks.sh"
    
    Show environment variables in build log: Checked
    Run script only when installing: Not checked
    
    Input Files: Empty
    Output Files: Empty
  7. Follow our setup guide to start using the SDK.

Upgrading the SDK version

When a new version of the SDK for iOS is released, you can update your project's version using one of the respective methods below.

CocoaPods

  1. Run pod update in the root of your project directory where your Podfile is located.