RadarPlace represents a place. Learn more about Places .
Properties
The Radar ID of the place.
The categories of the place. For a full list of categories, see Place Categories .
The chain of the place, if known. May be nil for places without a chain. For a full list of chains, see Place Chains . The unique ID of the chain.
The external ID of the chain.
The optional set of custom key-value pairs for the chain.
The location of the place. coordinate
CLLocationCoordinate2D
required
The coordinate.
The group for the place, if any. For a full list of groups, see Place Groups .
The metadata for the place, if part of a group. For details of metadata fields see Place Groups .
The address of the place. coordinate
CLLocationCoordinate2D
required
The location coordinate of the address.
The formatted string representation of the address.
The name of the country of the address.
The unique code of the country of the address.
The flag of the country of the address.
The name of the state of the address.
The unique code of the state of the address.
The postal code of the address.
The borough of the address.
The county of the address.
The neighborhood of the address.
The street number of the address.
The street name of the address.
Methods
isChain
- ( BOOL )isChain:( NSString * _Nullable)slug;
Returns a boolean indicating whether the place is part of the specified chain.
Parameters:
slug - The chain slug to check
Returns: true if the place is part of the specified chain, false otherwise.
hasCategory
- ( BOOL )hasCategory:( NSString * _Nullable)category;
Returns a boolean indicating whether the place has the specified category.
Parameters:
category - The category to check
Returns: true if the place has the specified category, false otherwise.
arrayForPlaces
+ ( NSArray < NSDictionary *> * _Nullable)arrayForPlaces:( NSArray < RadarPlace *> * _Nullable)places;
Converts an array of RadarPlace objects to an array of dictionaries.
dictionaryValue
- ( NSDictionary * _Nonnull)dictionaryValue;
Returns the dictionary representation of the place.
Example
let place: RadarPlace = event. place
let placeId = place. _id
let placeName = place. name
let placeCategories = place. categories
let placeChain = place. chain
let placeLocation = place. location
if place. isChain ( "starbucks" ) {
// place is a Starbucks
}
if place. hasCategory ( "coffee-shop" ) {
// place is a coffee shop
}
RadarPlace * place = event.place;
NSString * placeId = place._id;
NSString * placeName = place.name;
NSArray < NSString *> * placeCategories = place.categories;
RadarChain * placeChain = place.chain;
RadarCoordinate * placeLocation = place.location;
if ([place isChain: @"starbucks" ]) {
// place is a Starbucks
}
if ([place hasCategory: @"coffee-shop" ]) {
// place is a coffee shop
}