AI-generated Key Takeaways
- 
          GMSAutocompletePredictionobjects represent predicted search queries based on partial user input.
- 
          Predictions include attributed text for the full description, primary text (place name), and secondary text (location). 
- 
          Each prediction provides a placeIDfor detailed place information requests and an array oftypesdescribing the result.
- 
          Optionally, distanceMetersindicates the distance from the origin specified in the request's filter.
GMSAutocompletePrediction
Deprecated
Use GMSAutocompleteSuggestion instead.
@interface GMSAutocompletePrediction : NSObjectThis class represents a prediction of a full query based on a partially typed string.
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.The full description of the prediction as a NSAttributedString. E.g., “Sydney Opera House, Sydney, New South Wales, Australia”. Every text range that matches the user input has a kGMSAutocompleteMatchAttribute. For example, you can make every match bold using enumerateAttribute:UIFont *regularFont = [UIFont systemFontOfSize:[UIFont labelFontSize]]; UIFont *boldFont = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]]; NSMutableAttributedString *bolded = [prediction.attributedFullText mutableCopy]; [bolded enumerateAttribute:kGMSAutocompleteMatchAttribute inRange:NSMakeRange(0, bolded.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) { UIFont *font = (value == nil) ? regularFont : boldFont; [bolded addAttribute:NSFontAttributeName value:font range:range]; }]; label.attributedText = bolded; DeclarationSwift @NSCopying var attributedFullText: NSAttributedString { get }Objective-C @property (nonatomic, copy, readonly) __GMS_AVAILABLE_BUT_DEPRECATED_MSG NSAttributedString *attributedFullText;
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.The main text of a prediction as a NSAttributedString, usually the name of the place. E.g. “Sydney Opera House”. Text ranges that match user input are have a kGMSAutocompleteMatchAttribute, likeattributedFullText.DeclarationSwift @NSCopying var attributedPrimaryText: NSAttributedString { get }Objective-C @property (nonatomic, copy, readonly) __GMS_AVAILABLE_BUT_DEPRECATED_MSG NSAttributedString *attributedPrimaryText;
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.The secondary text of a prediction as a NSAttributedString, usually the location of the place. E.g. “Sydney, New South Wales, Australia”. Text ranges that match user input are have a kGMSAutocompleteMatchAttribute, likeattributedFullText.May be nil. DeclarationSwift @NSCopying var attributedSecondaryText: NSAttributedString? { get }Objective-C @property (nonatomic, copy, readonly, nullable) NSAttributedString *attributedSecondaryText;
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.A property representing the place ID of the prediction, suitable for use in a place details request. DeclarationSwift var placeID: String { get }Objective-C @property (nonatomic, copy, readonly) __GMS_AVAILABLE_BUT_DEPRECATED_MSG NSString *placeID;
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.The types of this autocomplete result. Types are NSStrings, valid values are any types documented at https://developers.google.com/places/ios-sdk/supported_types. DeclarationSwift var types: [String] { get }Objective-C @property (nonatomic, copy, readonly) __GMS_AVAILABLE_BUT_DEPRECATED_MSG NSArray<NSString *> *types;
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.The straight line distance in meters between the origin and this prediction if a valid origin is specified in the GMSAutocompleteFilterof the request.DeclarationSwift var distanceMeters: NSNumber? { get }Objective-C @property (nonatomic, readonly, nullable) NSNumber *distanceMeters;
- 
                  
                  Deprecated Use GMSAutocompleteSuggestioninstead.Unavailable Initializer is not available. DeclarationObjective-C - (nonnull instancetype)init;