Inherits from NSObject
Declared in SmileWeatherDownLoader.h

Tasks

Properties

weatherAPI

@property (nonatomic, readonly) SmileWeatherAPI weatherAPI
Discussion

The weather api used for your project, please set it in your info.plist in advance.

Declared In

SmileWeatherDownLoader.h

Class Methods

placeNameForDisplay:

+ (nonnull NSString *)placeNameForDisplay:(nonnull CLPlacemark *)placemark
Discussion

Optimized placename for display in the normal scene.

Declared In

SmileWeatherDownLoader.h

placeNameForSearchDisplay:

+ (nonnull NSString *)placeNameForSearchDisplay:(nonnull CLPlacemark *)placemark
Discussion

Optimized placename for display in the search bar scene.

Declared In

SmileWeatherDownLoader.h

sharedDownloader

+ (nonnull SmileWeatherDownLoader *)sharedDownloader

Instance Methods

getPlacemarksForSearchDisplayFromString:completion:

- (void)getPlacemarksForSearchDisplayFromString:(nonnull NSString *)string completion:(nonnull SmileWeatherPlacemarksCompletion)completion
Discussion

This method submits the specified string to the weather server asynchronously and returns array of CLPlacemark. Your completion handler block will be executed on the main thread.

Parameters

string

The string is submited for search.

completion

A block object containing the code to execute at the end of the request. This code is called whether the request is successful or unsuccessful.

Declared In

SmileWeatherDownLoader.h

getPlacemarksFromString:completion:

- (void)getPlacemarksFromString:(nonnull NSString *)string completion:(nonnull SmileWeatherPlacemarksCompletion)completion
Discussion

This method submits the specified String to the weather server asynchronously and returns array of CLPlacemark. Your completion handler block will be executed on the main thread.

Parameters

string

The string is submited for search.

completion

A block object containing the code to execute at the end of the request. This code is called whether the request is successful or unsuccessful.

Declared In

SmileWeatherDownLoader.h

getWeatherDataFromLocation:completion:

- (void)getWeatherDataFromLocation:(nonnull CLLocation *)location completion:(nonnull SmileWeatherDataDownloadCompletion)completion
Discussion

This method submits the specified CLLocation data to the weather server asynchronously and returns well formed data ‘SmileWeatherData’ for using easily. Your completion handler block will be executed on the main thread.

Parameters

location

The CLPlacemark is submited for weather data.

completion

A block object containing the code to execute at the end of the request. This code is called whether the request is successful or unsuccessful.

Declared In

SmileWeatherDownLoader.h

getWeatherDataFromPlacemark:completion:

- (void)getWeatherDataFromPlacemark:(nonnull CLPlacemark *)placeMark completion:(nonnull SmileWeatherDataDownloadCompletion)completion
Discussion

This method submits the specified CLPlacemark data to the weather server asynchronously and returns well formed data ‘SmileWeatherData’ for using easily. Your completion handler block will be executed on the main thread.

Parameters

placeMark

The CLPlacemark is submited for weather data.

completion

A block object containing the code to execute at the end of the request. This code is called whether the request is successful or unsuccessful.

Declared In

SmileWeatherDownLoader.h

getWeatherRawDataFromURL:completion:

- (void)getWeatherRawDataFromURL:(nonnull NSURL *)url completion:(nonnull SmileWeatherRawDataCompletion)completion

getWeatherRawDicFromURL:completion:

- (void)getWeatherRawDicFromURL:(nonnull NSURL *)url completion:(nonnull SmileWeatherRawDicCompletion)completion

preferedLanguage

- (nonnull NSString *)preferedLanguage
Discussion

Current prefered language for device.

Declared In

SmileWeatherDownLoader.h