How to extract street, city, etc. from GMSPlace Address Components

后端 未结 10 1906
栀梦
栀梦 2021-02-20 02:51

I\'m using Google Places API for iOS and can successfully retrieve nearby places and present the address as a string. What I\'m trying to do is extract address components such

10条回答
  •  野性不改
    2021-02-20 03:39

    for ( GMSAddressComponent * component in place.addressComponents) {
        if ( [component.type  isEqual: @"locality"] )
        {
            NSLog(@"Current city %@ ", component.name);
        }
    }
    

提交回复
热议问题