AWFPlace

@interface AWFPlace : AWFGeographicObject

An AWFPlace object represents data returned by the places endpoint of the Aeris Weather API.

  • The coordinate based on the defined latitude and longitude values.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CLLocationCoordinate2D coordinate;

    Swift

    var coordinate: CLLocationCoordinate2D { get set }
  • A CLLocation instance using the assigned coordinate for this object.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) CLLocation *location;

    Swift

    var location: CLLocation? { get set }
  • Primary name of the location.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *name;

    Swift

    var name: String? { get set }
  • Abbreviated state or province for the location, if available.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *state;

    Swift

    var state: String? { get set }
  • Full state or province name for the location, if available.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *stateFull;

    Swift

    var stateFull: String? { get set }
  • Abbreviated country for the location.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *country;

    Swift

    var country: String? { get set }
  • Full country name for the location.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *countryFull;

    Swift

    var countryFull: String? { get set }
  • County name for the location.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *county;

    Swift

    var county: String? { get set }
  • Full place name formatted with the state and country when available.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *formattedNameFull;

    Swift

    var formattedNameFull: String? { get }
  • Zip code associated with the place, if defined.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *zipcode;

    Swift

    var zipcode: String? { get set }
  • Abbreviated geographical region for the location (US-based locations only).

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *region;

    Swift

    var region: String? { get set }
  • Geographical region for the location (US-based locations only).

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *regionFull;

    Swift

    var regionFull: String? { get set }
  • Abbreviated continent the location belongs to.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *continent;

    Swift

    var continent: String? { get set }
  • Full continent name the location belongs to.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *continentFull;

    Swift

    var continentFull: String? { get set }
  • Local time zone object for the location.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSTimeZone *timeZone;

    Swift

    var timeZone: TimeZone? { get set }
  • Whether or not the location is current observing daylight savings time (DST).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL isDst;

    Swift

    var isDst: Bool { get set }
  • Elevation of the location in meters.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat elevationM;

    Swift

    var elevationM: CGFloat { get set }
  • Elevation of the location in feet.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat elevationFT;

    Swift

    var elevationFT: CGFloat { get set }
  • Population of the location.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat population;

    Swift

    var population: CGFloat { get set }
  • Initializes and returns a newly allocated place object with the specified city, state, and/or country strings.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCity:(nonnull NSString *)city
                                   state:(nullable NSString *)state
                                 country:(nonnull NSString *)country;

    Swift

    init(city: String, state: String?, country: String)

    Return Value

    An initialized place object.

  • Initializes and returns a newly allocated place object with the specified latitude and longitude values.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithLatitude:(CGFloat)latitude
                                   longitude:(CGFloat)longitude;

    Swift

    init(latitude: CGFloat, longitude: CGFloat)

    Return Value

    An initialized place object.

  • Initializes and returns a newly allocated place object with the specified zip code string.

    Only US and Canadian zip codes are currently supported.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithZipcode:(nonnull NSString *)zipcode;

    Swift

    init(zipcode: String)

    Return Value

    An initialized place object.

  • Generates the place string properly formatted for API requests based on this place configuration.

    Declaration

    Objective-C

    - (nullable NSString *)stringForQuery;

    Swift

    func stringForQuery() -> String?
  • Generates the string required for direct-queries via the API based on this place configuration.

    Declaration

    Objective-C

    - (nullable NSString *)stringForSearch;

    Swift

    func stringForSearch() -> String?
  • Returns whether the place is valid based on the resulting string used for API queries.

    Declaration

    Objective-C

    - (BOOL)isValid;

    Swift

    func isValid() -> Bool
  • Determines whether the receiver is equal to the specified place by comparing the place name.

    Declaration

    Objective-C

    - (BOOL)isEqualToPlaceByComparingName:(nonnull AWFPlace *)place;

    Swift

    func isEqualToPlace(byComparingName place: AWFPlace) -> Bool

    Parameters

    place

    The place to compare

    Return Value

    YES if the receiver’s name is equal to the place, otherwise NO

  • Initializes and returns a newly allocated place object with the specified city, state, and/or country strings.

    Declaration

    Objective-C

    + (nonnull instancetype)placeWithCity:(nonnull NSString *)city
                                    state:(nullable NSString *)state
                                  country:(nonnull NSString *)country;

    Return Value

    An initialized place object.

  • Initializes and returns a newly allocated place object with the specified latitude and longitude values.

    Declaration

    Objective-C

    + (nonnull instancetype)placeWithLatitude:(CGFloat)latitude
                                    longitude:(CGFloat)longitude;

    Return Value

    An initialized place object.

  • Initializes and returns a newly allocated place object with the specified coordinate.

    Declaration

    Objective-C

    + (nonnull instancetype)placeWithCoordinate:(CLLocationCoordinate2D)coordinate;

    Swift

    convenience init(coordinate: CLLocationCoordinate2D)

    Return Value

    An initialized place object.

  • Initializes and returns a newly allocated place object with the specified zip code string.

    Only US and Canadian zip codes are currently supported.

    Declaration

    Objective-C

    + (nonnull instancetype)placeWithZipcode:(nonnull NSString *)zipcode;

    Return Value

    An initialized place object.

  • Initializes and returns a newly allocated place object with the specified place string. The string can be in the format of city,state,country, city,country, lat,lon, or zipcode, etc.

    Declaration

    Objective-C

    + (nonnull instancetype)placeFromString:(nonnull NSString *)string;

    Swift

    convenience init(from string: String)

    Parameters

    string

    The place string

    Return Value

    An initializes place object

  • Requests and returns a place object corresponding to the device’s current location. Location services must be enabled in order for the place to be returned.

    Declaration

    Objective-C

    + (void)getCurrentLocationWithCompletion:
        (nonnull AWFPlaceGeolocateCompletionBlock)completionBlock;

    Swift

    class func getCurrentLocation(completion completionBlock: @escaping AWFPlaceGeolocateCompletionBlock)

    Parameters

    completionBlock

    The completion block to execute on the success or failure of the place request. This block has no return value and takes two arguments: the AWFPlace instance associated with the device’s current location, if any, and the error that occurred during the request.