I'm using the MKPlacemark
class to populate a label with location specifics. When calling the AdministrativeArea
property, the entire name of the US state is returned (e.g. West Virginia). Is there a way to return ONLY the initials (e.g. WV)?
MKPlacemark: return US state abbreviation in AdministrativeArea
1.4k views Asked by dbarrett At
1
Apple's docs for that property suggest that there's no real definition for what it can contain. Your best bet is probably to create a function to map from the full state name to the 2 letter code, and pass the result of the property through it before display. I would default to the original string if you don't get a match.