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
Swift 4
var keys = [String]() place.addressComponents?.forEach{keys.append($0.type)} var values = [String]() place.addressComponents?.forEach({ (component) in keys.forEach{ component.type == $0 ? values.append(component.name): nil} }) print(values)