AI-generated Key Takeaways
-
GMSAddressComponentrepresents parts of an address like street number, city, or postcode. -
It provides the component's name (e.g., "Sydney"), type (e.g., "locality"), and potentially a short name (e.g., "AU").
-
The
typeproperty is deprecated; usetypesinstead for an array of type constants fromGMSPlaceTypes.h. -
You can find supported type values at: https://developers.google.com/places/ios-sdk/supported_types#table2.
GMSAddressComponent
@interface GMSAddressComponent : NSObjectRepresents a component of an address, e.g., street number, postcode, city, etc.
-
Deprecated
type property is deprecated in favor of types
Type of the address component. For a list of supported types, see https://developers.google.com/places/ios-sdk/supported_types#table2. This string will be one of the constants defined in GMSPlaceTypes.h.
Declaration
Swift
var type: String { get }Objective-C
@property (nonatomic, copy, readonly) __GMS_AVAILABLE_BUT_DEPRECATED_MSG NSString *type; -
Types associated with the address component. For a list of supported types, see https://developers.google.com/places/ios-sdk/supported_types#table2. This array will contain one or more of the constants strings defined in GMSPlaceTypes.h.
Declaration
Swift
var types: [String] { get }Objective-C
@property (nonatomic, strong, readonly) NSArray<NSString *> *_Nonnull types; -
Name of the address component, e.g. “Sydney”
Declaration
Swift
var name: String { get }Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull name; -
Short name of the address component, e.g. “AU”
Declaration
Swift
var shortName: String? { get }Objective-C
@property (nonatomic, copy, readonly) NSString *_Nullable shortName;