AI-generated Key Takeaways
-
GMSAddressstores human-readable address information obtained from reverse geocoding requests usingGMSGeocoder. -
It contains properties for various address components like coordinate, street, city, region, postal code, and country.
-
The
linesproperty provides an array of formatted address lines, offering a comprehensive representation. -
While
addressLine1andaddressLine2were previously used, they are now deprecated in favor of thelinesproperty. -
Some address fields may be nil if the information is unavailable.
GMSAddress
@interface GMSAddress : NSObject <NSCopying, NSSecureCoding>A result from a reverse geocode request, containing a human-readable address. This class is
immutable and should not be instantiated directly unless under testing circumstances. Obtain an
instance via GMSGeocoder.
Some of the fields may be nil, indicating they are not present.
-
Location, or kLocationCoordinate2DInvalid if unknown.
Declaration
Swift
var coordinate: CLLocationCoordinate2D { get }Objective-C
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate; -
Street number and name.
Declaration
Swift
var thoroughfare: String? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *thoroughfare; -
Locality or city.
Declaration
Swift
var locality: String? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *locality; -
Subdivision of locality, district or park.
Declaration
Swift
var subLocality: String? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *subLocality; -
Region/State/Administrative area.
Declaration
Swift
var administrativeArea: String? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *administrativeArea; -
Postal/Zip code.
Declaration
Swift
var postalCode: String? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *postalCode; -
The country name.
Declaration
Swift
var country: String? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *country; -
An array of
NSStringcontaining formatted lines of the address. May be nil.Declaration
Swift
var lines: [String]? { get }Objective-C
@property (nonatomic, copy, readonly, nullable) NSArray<NSString *> *lines; -
Deprecated
This method is obsolete and will be removed in a future release. Use the lines property instead.
Returns the first line of the address.
Declaration
Swift
func addressLine1() -> String?Objective-C
- (nullable NSString *)addressLine1; -
Deprecated
This method is obsolete and will be removed in a future release. Use the lines property instead.
Returns the second line of the address.
Declaration
Swift
func addressLine2() -> String?Objective-C
- (nullable NSString *)addressLine2;