AI-generated Key Takeaways
- 
          GMSAutocompleteFetchersimplifies the process of getting autocomplete predictions as the user types.
- 
          It might not request predictions for every text change to optimize performance. 
- 
          Predictions are only returned for the most recent text provided. 
- 
          A delegate is notified with the prediction results. 
- 
          You can customize the predictions using a filter and track queries with a session token. 
GMSAutocompleteFetcher
Deprecated
Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback: instead.
@interface GMSAutocompleteFetcher : NSObject
/**
 * Initialize the fetcher.
 *
 * @param filter The filter to apply to the results. This parameter may be nil.
 */
- (instancetype)initWithFilter:(nullable GMSAutocompleteFilter *)filter NS_DESIGNATED_INITIALIZER
    __GMS_AVAILABLE_BUT_DEPRECATED_MSG(
        "Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
        "instead.")
        ;
/** Delegate to be notified with autocomplete prediction results. */
@property(nonatomic, weak, nullable) id<GMSAutocompleteFetcherDelegate> delegate
    __GMS_AVAILABLE_BUT_DEPRECATED_MSG(
        "Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
        "instead.")
        ;
/** Filter to apply to autocomplete suggestions (can be nil). */
@property(nonatomic, strong, nullable) GMSAutocompleteFilter *autocompleteFilter
    __GMS_AVAILABLE_BUT_DEPRECATED_MSG(
        "Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
        "instead.")
        ;
/** Provide a `GMSAutocompleteSessionToken` for tracking the specific autocomplete query flow. */
- (void)provideSessionToken:(nullable GMSAutocompleteSessionToken *)sessionToken
    __GMS_AVAILABLE_BUT_DEPRECATED_MSG(
        "Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
        "instead.")
        ;
/**
 * Notify the fetcher that the source text to autocomplete has changed.
 *
 * This method should only be called from the main thread. Calling this method from another thread
 * will result in undefined behavior. Calls to `GMSAutocompleteFetcherDelegate` methods will also be
 * called on the main thread.
 *
 * This method is non-blocking.
 * @param text The partial text to autocomplete.
 */
- (void)sourceTextHasChanged:(nullable NSString *)text
    __GMS_AVAILABLE_BUT_DEPRECATED_MSG(
        "Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
        "instead.")
        ;
@end- 
                  
                  Deprecated Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:instead.Initialize the fetcher. DeclarationSwift init(filter: GMSAutocompleteFilter?)Objective-C - (nonnull instancetype)initWithFilter:(nullable GMSAutocompleteFilter *)filter;ParametersfilterThe filter to apply to the results. This parameter may be nil. 
- 
                  
                  Deprecated Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:instead.Delegate to be notified with autocomplete prediction results. DeclarationSwift weak var delegate: (any GMSAutocompleteFetcherDelegate)? { get set }Objective-C @property (nonatomic, weak, nullable) id<GMSAutocompleteFetcherDelegate> delegate;
- 
                  
                  Deprecated Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:instead.Filter to apply to autocomplete suggestions (can be nil). DeclarationSwift var autocompleteFilter: GMSAutocompleteFilter? { get set }Objective-C @property (nonatomic, strong, nullable) GMSAutocompleteFilter *autocompleteFilter;
- 
                  
                  Deprecated Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:instead.Provide a GMSAutocompleteSessionTokenfor tracking the specific autocomplete query flow.DeclarationSwift func provide(_ sessionToken: GMSAutocompleteSessionToken?)Objective-C - (void)provideSessionToken: (nullable GMSAutocompleteSessionToken *)sessionToken;
- 
                  
                  Deprecated Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:instead.Notify the fetcher that the source text to autocomplete has changed. This method should only be called from the main thread. Calling this method from another thread will result in undefined behavior. Calls to GMSAutocompleteFetcherDelegatemethods will also be called on the main thread.This method is non-blocking. DeclarationSwift func sourceTextHasChanged(_ text: String?)Objective-C - (void)sourceTextHasChanged:(nullable NSString *)text;ParameterstextThe partial text to autocomplete.