Setting Up the SDK

Once you've integrated the Aeris Weather SDK for iOS into your project, you'll need to setup your project to start using the SDK.

The Aeris Weather SDK for iOS is written in Objective-C, but since it's pre-compiled as dynamic frameworks, it's easy to use in either Swift or Objective-C projects. Use either the Swift or Objective-C methods below to get started.

Getting Started with Swift

  1. Make sure you have an active Aeris subscription and have valid API keys for use under your account for your application. Follow the Aeris API getting started guide if you haven't completed this process yet.
  2. Import AerisWeatherKit in the application delegate:

    import AerisWeatherKit
  3. Setup the SDK with your application's API keys in the application:didFinishLaunchingWithOptions: application delegate method:

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    
        AerisWeather.start(withApiKey: "__CLIENT_ID__", secret: "__CLIENT_SECRET__")
    
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.backgroundColor = UIColor.whiteColor()
        window?.makeKeyAndVisible()
    
        return true
    }
  4. In the Swift files you wish to use any of the Aeris Weather SDK libraries, import the appropriate modules:

    import AerisWeatherKit
    import AerisMapKit
    import AerisMapboxMapKit
    import AerisGoogleMapKit
  5. You're now ready to start loading data in your application! Review our data loading or weather map guides for more information and examples. You can also reference the complete set of developer docs for each SDK for more information about classes, methods and properties.

Getting Started with Objective-C

  1. Make sure you have an active Aeris subscription and have valid API keys for use under your account for your application. Follow the Aeris API getting started guide if you haven't completed this process yet.
  2. Import AerisWeatherKit in the application delegate:

    @import AerisWeatherKit;

    or without modules enabled:

    #import <AerisWeatherKit/AerisWeatherKit.h>
  3. Setup the SDK with your application's API keys in the application:didFinishLaunchingWithOptions: application delegate method:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
        [AerisWeather startWithApiKey:@"__CLIENT_ID__" secret:@"__CLIENT_SECRET__"];
    
        self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        self.window.backgroundColor = [UIColor whiteColor];
        [self.window makeKeyAndVisible];
    
        return YES;
    }
  4. In the Objective-C files you wish to use any of the Aeris Weather SDK libraries, import the appropriate frameworks:

    @import AerisWeatherKit
    @import AerisMapKit
    @import AerisMapboxMapKit
    @import AerisGoogleMapKit

    or without modules enabled:

    #import <AerisWeatherKit/AerisWeatherKit.h>
    #import <AerisMapKit/AerisMapKit.h>
    #import <AerisMapboxMapKit/AerisMapboxMapKit.h>
    #import <AerisGoogleMapKit/AerisGoogleMapKit.h>
  5. You're now ready to start loading data in your application! Review our data loading or weather map guides for more information and examples. You can also reference the complete set of developer docs for each SDK for more information about classes, methods and properties.

Logging & Debugging

By default, the logging level of the Aeris Weather SDK for iOS is set to output for the warning and error levels only. However, during development you may need to view more detailed output when using the SDK, such as requests being made or other informational details.

You can toggle debug mode on or off depending on how much logging output you need. By default debug mode is disabled. However, you can enable it in your application delegate:

[[AerisWeather sharedInstance] setDebugMode:YES];
AerisWeather.sharedInstance().debugMode = true

To disable debug mode, just pass NO or false to the above method, or remove the call to setDebugMode: and the SDK will fall back to the default of debug mode being disabled.