Skip to content

Commit

Permalink
Updated to GooglePlaces 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-anders committed Jun 19, 2017
1 parent 182a888 commit 02d61e5
Show file tree
Hide file tree
Showing 79 changed files with 175 additions and 232 deletions.
1 change: 0 additions & 1 deletion Cartfile

This file was deleted.

1 change: 0 additions & 1 deletion Cartfile.resolved

This file was deleted.

14 changes: 5 additions & 9 deletions GooglePlaces/GMSAddressComponent.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
// Service: https://developers.google.com/maps/terms
//

#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#import <Foundation/Foundation.h>

GMS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN

/**
* Represents a component of an address, e.g., street number, postcode, city, etc.
Expand All @@ -23,8 +19,8 @@ GMS_ASSUME_NONNULL_BEGIN

/**
* Type of the address component. For a list of supported types, see
* https://developers.google.com/places/supported_types#table2. This string will be one of the
* constants defined in GMSPlaceTypes.h.
* https://developers.google.com/places/ios-api/supported_types#table2. This string will be one
* of the constants defined in GMSPlaceTypes.h.
*/
@property(nonatomic, readonly, copy) NSString *type;

Expand All @@ -33,4 +29,4 @@ GMS_ASSUME_NONNULL_BEGIN

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
24 changes: 9 additions & 15 deletions GooglePlaces/GMSAutocompleteFetcher.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
// Service: https://developers.google.com/maps/terms
//

#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#if __has_feature(modules)
@import GoogleMapsBase;
#else
Expand All @@ -22,7 +17,7 @@

@class GMSAutocompletePrediction;

GMS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN

/**
* Protocol for objects that can receive callbacks from GMSAutocompleteFetcher
Expand All @@ -35,7 +30,7 @@ GMS_ASSUME_NONNULL_BEGIN
* Called when autocomplete predictions are available.
* @param predictions an array of GMSAutocompletePrediction objects.
*/
- (void)didAutocompleteWithPredictions:(GMS_NSArrayOf(GMSAutocompletePrediction *) *)predictions;
- (void)didAutocompleteWithPredictions:(NSArray<GMSAutocompletePrediction *> *)predictions;

/**
* Called when an autocomplete request returns an error.
Expand Down Expand Up @@ -64,18 +59,17 @@ GMS_ASSUME_NONNULL_BEGIN
* be returned outside of these bounds. This parameter may be nil.
* @param filter The filter to apply to the results. This parameter may be nil.
*/
- (instancetype)initWithBounds:(GMSCoordinateBounds *GMS_NULLABLE_PTR)bounds
filter:(GMSAutocompleteFilter *GMS_NULLABLE_PTR)filter
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithBounds:(nullable GMSCoordinateBounds *)bounds
filter:(nullable GMSAutocompleteFilter *)filter NS_DESIGNATED_INITIALIZER;

/** Delegate to be notified with autocomplete prediction results. */
@property(nonatomic, weak) id<GMSAutocompleteFetcherDelegate> GMS_NULLABLE_PTR delegate;
@property(nonatomic, weak, nullable) id<GMSAutocompleteFetcherDelegate> delegate;

/** Bounds used to bias the autocomplete search (can be nil). */
@property(nonatomic, strong) GMSCoordinateBounds *GMS_NULLABLE_PTR autocompleteBounds;
@property(nonatomic, strong, nullable) GMSCoordinateBounds *autocompleteBounds;

/** Filter to apply to autocomplete suggestions (can be nil). */
@property(nonatomic, strong) GMSAutocompleteFilter *GMS_NULLABLE_PTR autocompleteFilter;
@property(nonatomic, strong, nullable) GMSAutocompleteFilter *autocompleteFilter;

/**
* Notify the fetcher that the source text to autocomplete has changed.
Expand All @@ -87,8 +81,8 @@ GMS_ASSUME_NONNULL_BEGIN
* This method is non-blocking.
* @param text The partial text to autocomplete.
*/
- (void)sourceTextHasChanged:(NSString *GMS_NULLABLE_PTR)text;
- (void)sourceTextHasChanged:(nullable NSString *)text;

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
14 changes: 6 additions & 8 deletions GooglePlaces/GMSAutocompleteFilter.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
// Service: https://developers.google.com/maps/terms
//

#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#import <Foundation/Foundation.h>

GMS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN

/**
* The type filters that may be applied to an autocomplete request to restrict results to different
* types.
*
* @related GMSAutocompleteFilter
*/
typedef NS_ENUM(NSInteger, GMSPlacesAutocompleteTypeFilter) {
/**
Expand Down Expand Up @@ -71,8 +69,8 @@ typedef NS_ENUM(NSInteger, GMSPlacesAutocompleteTypeFilter) {
* The country to restrict results to. This should be a ISO 3166-1 Alpha-2 country code (case
* insensitive). If nil, no country filtering will take place.
*/
@property(nonatomic, copy) NSString *GMS_NULLABLE_PTR country;
@property(nonatomic, copy, nullable) NSString *country;

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
10 changes: 3 additions & 7 deletions GooglePlaces/GMSAutocompleteMatchFragment.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
//


#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#import <Foundation/Foundation.h>

GMS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN

/**
* This class represents a matched fragment of a string. This is a contiguous range of characters
Expand All @@ -36,4 +32,4 @@ GMS_ASSUME_NONNULL_BEGIN

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
22 changes: 9 additions & 13 deletions GooglePlaces/GMSAutocompletePrediction.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
//


#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
NS_ASSUME_NONNULL_BEGIN

GMS_ASSUME_NONNULL_BEGIN

/*
/**
* Attribute name for match fragments in |GMSAutocompletePrediction| attributedFullText.
*
* @related GMSAutocompletePrediction
*/
extern NSString *const kGMSAutocompleteMatchAttribute;

Expand Down Expand Up @@ -69,20 +65,20 @@ extern NSString *const kGMSAutocompleteMatchAttribute;
*
* May be nil.
*/
@property(nonatomic, copy, readonly) NSAttributedString *GMS_NULLABLE_PTR attributedSecondaryText;
@property(nonatomic, copy, readonly, nullable) NSAttributedString *attributedSecondaryText;

/**
* An optional property representing the place ID of the prediction, suitable for use in a place
* details request.
*/
@property(nonatomic, copy, readonly) NSString *GMS_NULLABLE_PTR placeID;
@property(nonatomic, copy, readonly, nullable) NSString *placeID;

/**
* The types of this autocomplete result. Types are NSStrings, valid values are any types
* documented at <https://developers.google.com/places/supported_types>.
* documented at <https://developers.google.com/places/ios-api/supported_types>.
*/
@property(nonatomic, copy, readonly) GMS_NSArrayOf(NSString *) *types;
@property(nonatomic, copy, readonly) NSArray<NSString *> *types;

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
22 changes: 7 additions & 15 deletions GooglePlaces/GMSAutocompleteResultsViewController.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

#import <UIKit/UIKit.h>

#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#if __has_feature(modules)
@import GoogleMapsBase;
#else
Expand All @@ -24,7 +19,7 @@
#import <GooglePlaces/GMSAutocompletePrediction.h>
#import <GooglePlaces/GMSPlace.h>

GMS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN

@class GMSAutocompleteResultsViewController;

Expand Down Expand Up @@ -90,7 +85,6 @@ GMS_ASSUME_NONNULL_BEGIN

@end


/**
* GMSAutocompleteResultsViewController provides an interface that displays place autocomplete
* predictions in a table view. The table view will be automatically updated as input text
Expand All @@ -104,18 +98,16 @@ GMS_ASSUME_NONNULL_BEGIN
* Use the |GMSAutocompleteResultsViewControllerDelegate| delegate protocol to be notified when a
* place is selected from the list.
*/
@interface GMSAutocompleteResultsViewController : UIViewController <
UISearchResultsUpdating>
@interface GMSAutocompleteResultsViewController : UIViewController <UISearchResultsUpdating>

/** Delegate to be notified when a place is selected. */
@property(nonatomic, weak)
id<GMSAutocompleteResultsViewControllerDelegate> GMS_NULLABLE_PTR delegate;
@property(nonatomic, weak, nullable) id<GMSAutocompleteResultsViewControllerDelegate> delegate;

/** Bounds used to bias the autocomplete search (can be nil). */
@property(nonatomic, strong) GMSCoordinateBounds *GMS_NULLABLE_PTR autocompleteBounds;
@property(nonatomic, strong, nullable) GMSCoordinateBounds *autocompleteBounds;

/** Filter to apply to autocomplete suggestions (can be nil). */
@property(nonatomic, strong) GMSAutocompleteFilter *GMS_NULLABLE_PTR autocompleteFilter;
@property(nonatomic, strong, nullable) GMSAutocompleteFilter *autocompleteFilter;

/** The background color of table cells. */
@property(nonatomic, strong) IBInspectable UIColor *tableCellBackgroundColor;
Expand All @@ -133,8 +125,8 @@ GMS_ASSUME_NONNULL_BEGIN
@property(nonatomic, strong) IBInspectable UIColor *secondaryTextColor;

/** The tint color applied to controls in the Autocomplete view. */
@property(nonatomic, strong) IBInspectable UIColor *GMS_NULLABLE_PTR tintColor;
@property(nonatomic, strong, nullable) IBInspectable UIColor *tintColor;

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
29 changes: 10 additions & 19 deletions GooglePlaces/GMSAutocompleteTableDataSource.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

#import <UIKit/UIKit.h>

#if __has_feature(modules)
@import GoogleMapsBase;
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#if __has_feature(modules)
@import GoogleMapsBase;
#else
Expand All @@ -24,7 +19,7 @@
#import <GooglePlaces/GMSAutocompletePrediction.h>
#import <GooglePlaces/GMSPlace.h>

GMS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN

@class GMSAutocompleteTableDataSource;

Expand Down Expand Up @@ -90,7 +85,6 @@ GMS_ASSUME_NONNULL_BEGIN

@end


/**
* GMSAutocompleteTableDataSource provides an interface for providing place autocomplete
* predictions to populate a UITableView by implementing the UITableViewDataSource and
Expand All @@ -99,9 +93,8 @@ GMS_ASSUME_NONNULL_BEGIN
* GMSAutocompleteTableDataSource is designed to be used as the data source for a
* UISearchDisplayController.
*
* NOTE: Unless iOS 7 compatibility is required, using UISearchController with
* |GMSAutocompleteResultsViewController| instead of UISearchDisplayController is highly
* recommended.
* NOTE: Using UISearchController with |GMSAutocompleteResultsViewController| instead of
* UISearchDisplayController is highly recommended.
*
* Set an instance of GMSAutocompleteTableDataSource as the searchResultsDataSource and
* searchResultsDelegate properties of UISearchDisplayController. In your implementation of
Expand All @@ -113,18 +106,16 @@ GMS_ASSUME_NONNULL_BEGIN
* UISearchDisplayController's table view.
*
*/
@interface GMSAutocompleteTableDataSource : NSObject <
UITableViewDataSource, UITableViewDelegate>
@interface GMSAutocompleteTableDataSource : NSObject <UITableViewDataSource, UITableViewDelegate>

/** Delegate to be notified when a place is selected or picking is cancelled. */
@property(nonatomic, weak)
IBOutlet id<GMSAutocompleteTableDataSourceDelegate> GMS_NULLABLE_PTR delegate;
@property(nonatomic, weak, nullable) IBOutlet id<GMSAutocompleteTableDataSourceDelegate> delegate;

/** Bounds used to bias the autocomplete search (can be nil). */
@property(nonatomic, strong) GMSCoordinateBounds *GMS_NULLABLE_PTR autocompleteBounds;
@property(nonatomic, strong, nullable) GMSCoordinateBounds *autocompleteBounds;

/** Filter to apply to autocomplete suggestions (can be nil). */
@property(nonatomic, strong) GMSAutocompleteFilter *GMS_NULLABLE_PTR autocompleteFilter;
@property(nonatomic, strong, nullable) GMSAutocompleteFilter *autocompleteFilter;

/** The background color of table cells. */
@property(nonatomic, strong) UIColor *tableCellBackgroundColor;
Expand All @@ -142,7 +133,7 @@ GMS_ASSUME_NONNULL_BEGIN
@property(nonatomic, strong) UIColor *secondaryTextColor;

/** The tint color applied to controls in the Autocomplete view. */
@property(nonatomic, strong) UIColor *GMS_NULLABLE_PTR tintColor;
@property(nonatomic, strong, nullable) UIColor *tintColor;

/** Designated initializer */
- (instancetype)init NS_DESIGNATED_INITIALIZER;
Expand All @@ -157,8 +148,8 @@ GMS_ASSUME_NONNULL_BEGIN
* This method is non-blocking.
* @param text The partial text to autocomplete.
*/
- (void)sourceTextHasChanged:(NSString *GMS_NULLABLE_PTR)text;
- (void)sourceTextHasChanged:(nullable NSString *)text;

@end

GMS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
Loading

0 comments on commit 02d61e5

Please sign in to comment.