The AerisWeather iOS SDK is built using Apple’s XCFramework format, which means that multiple platforms are supported for each of our frameworks.
To get started with the AerisWeather SDK for iOS/tvOS, you’ll need to integrate the SDK into an existing project.
The AerisWeather SDK for iOS/tvOS has the following requirements:
You can review the demo application that already has the SDK integrated with sample code and views.
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.
As of version 3.3.0 of the AerisWeather iOS SDK, libraries are built as XCFrameworks. This means you must be using version 1.10.0 or higher of CocoaPods that fully support XCFramework dependcies.
Make sure you have CocoaPods installed and working. If you don’t have CocoaPods installed on your system, follow the installation instructions to get started. If you’re new to or unfamiliar with CocoaPods, also make sure to review its usage guide to learn more about how to get started with CocoaPods for your project.
Add the AerisWeather
pod to your Podfile
. This will add the base AerisWeatherKit.framework and its core dependencies to your project.
pod 'AerisWeather'
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'
Run pod install
from the Terminal at the root of your project where your Podfile
is located.
Open your *.xcworkspace
file with Xcode. Do NOT use *.xcodeproj
as you’ll receive ld: library not found
errors for the AerisWeather libraries.
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
Follow our setup guide to start using the SDK.
Note that as of January 2021 and version 0.36.x, Carthage does not currently support XCFrameworks. This is a planned feature for the upcoming 0.37.0 release, however. If you currently use Carthage for integrating the AerisWeather iOS SDK, you must use versions older than 3.3.0 of our SDK until Carthage fully supports XCFrameworks.
Install the latest version of Carthage.
Add the following to your Cartfile
:
binary "/downloads/ios/AerisWeather.json"
Run carthage update
.
In your app target’s General settings tab, under the Linked Frameworks and Libraries section, drag and drop all the Aeris###.framework
files (e.g. AerisCore.framework
, AerisWeatherKit.framework
, etc) you wish to use from the Carthage/Build/iOS
folder on disk except for AerisGoogleMapKit.framework.
In the Build Phases tab, click the + icon and choose New Run Script Phase. Create a Run Script phase and add the following to the script area below the shell:
/usr/local/bin/carthage copy-frameworks
Then add the framework paths to the Input Files for this script phase:
$(SRCROOT)/Carthage/Build/iOS/AerisCore.framework
$(SRCROOT)/Carthage/Build/iOS/AerisCoreUI.framework
$(SRCROOT)/Carthage/Build/iOS/AerisWeatherKit.framework
...
Review the Carthage setup documentation for more information about setting up your project.
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
If you are using Google Maps, you’ll also need to add AerisGoogleMapKit.framework to your project’s Link Binary with Library build phase since it’s a static framework and cannot be loaded dynamically. You can skip this step if you aren’t using the SDK with Google Maps.
Follow our setup guide to start using the SDK.
As of version 3.3.0 of the AerisWeather iOS SDK, libraries are built to support multiple platforms in Apple’s supported XCFramework format.
The AerisWeather iOS SDK is released as dynamic frameworks for versions prior to 3.3.0. If you are using the latest releases, use the XCFramework installation method above instead.
Download the latest version of the AerisWeather SDK for iOS and decompress the downloaded archive file.
With your project open in Xcode, select your Target. Under the General tab, find Embedded Binaries and then click the + button.
Click the Add Other… button, navigate to the Aeris###
.framework` files you need located within the decompressed directory you downloaded and select them except for AerisGoogleMapKit.framework. Make sure to check the Destination: Copy items if needed checkbox when prompted.
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
If you are using Google Maps, you’ll also need to add AerisGoogleMapKit.framework to your project’s Link Binary with Library build phase since it’s a static framework and cannot be loaded dynamically. You can skip this step if you aren’t using the SDK with Google Maps.
Follow our setup guide to start using the SDK.
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.
pod update
in the root of your project directory where your Podfile
is located.carthage update
in the root of your project directory.AerisCore.framework
, AerisWeatherKit.framework
, etc) in the Project Navigator and hit delete on your keyboard. Then select Move to Trash.Last modified: March 09, 2021