File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,14 @@ - (id)initWithDictionary:(NSDictionary *)result {
48
48
if ([types containsObject: @" street_number" ])
49
49
self.subThoroughfare = [component objectForKey: @" long_name" ];
50
50
51
- if ([types containsObject: @" route" ])
52
- self.thoroughfare = [component objectForKey: @" long_name" ];
51
+ if ([types containsObject: @" route" ]) {
52
+ NSString *shortName = [component objectForKey: @" short_name" ];
53
+ if ([self .formattedAddress rangeOfString: shortName].location != NSNotFound ) {
54
+ self.thoroughfare = shortName;
55
+ } else {
56
+ self.thoroughfare = [component objectForKey: @" long_name" ];
57
+ }
58
+ }
53
59
54
60
if ([types containsObject: @" administrative_area_level_3" ] || [types containsObject: @" sublocality" ] || [types containsObject: @" neighborhood" ])
55
61
self.subLocality = [component objectForKey: @" long_name" ];
You can’t perform that action at this time.
0 commit comments