Skip to content

Commit

Permalink
Swift4 (#22)
Browse files Browse the repository at this point in the history
* Update GooglePlaces to 2.5

* Migrate to Swift 4
  • Loading branch information
mats-claassen committed Feb 1, 2018
1 parent b446216 commit 07c295f
Show file tree
Hide file tree
Showing 113 changed files with 450 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "xmartlabs/Eureka" ~> 3.0
github "xmartlabs/Eureka" ~> 4.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git "file:///Users/mathiasclaasen/Developer/Eureka" "2ca4188a722eb0dda6f714d6aecfab84aad018fe"
github "xmartlabs/Eureka" "4.0.1"
22 changes: 18 additions & 4 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0920;
TargetAttributes = {
28F828CB1C4B714D00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0920;
};
};
};
Expand Down Expand Up @@ -289,14 +289,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -335,14 +341,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -381,7 +393,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -399,7 +412,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewController: FormViewController {
+++ Section("Choose from table view")
<<< GooglePlacesTableRow("tableview(2)"){
$0.onNetworkingError = { error in
print(error)
print(error ?? "There was a netwrok error")
}
}
+++ Section("Customized cell, customized layout")
Expand Down
1 change: 0 additions & 1 deletion Frameworks/GoogleMapsBase.framework/Headers

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#import <CoreLocation/CoreLocation.h>

NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN;

/**
* GMSCoordinateBounds represents a rectangular bounding box on the Earth's surface.
Expand All @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
* When an invalid bounds is expanded with valid coordinates via includingCoordinate: or
* includingBounds:, the resulting bounds will be valid but contain only the new coordinates.
*/
@property(readonly, getter=isValid) BOOL valid;
@property(nonatomic, readonly, getter=isValid) BOOL valid;

/**
* Inits the northEast and southWest bounds corresponding to the rectangular region defined by the
Expand Down Expand Up @@ -72,4 +72,4 @@ NS_ASSUME_NONNULL_BEGIN

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END;
22 changes: 22 additions & 0 deletions Frameworks/GoogleMapsBase.framework/Headers/GMSDeprecationMacros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// GMSDeprecationMacros.h
// Google Maps SDK for iOS
//
// Copyright 2015 Google Inc.
//
// Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
// Service: https://developers.google.com/maps/terms
//

#ifndef IPHONE_MAPS_SDK_BASE_GMSDEPRECATIONMACROS_H_
#define IPHONE_MAPS_SDK_BASE_GMSDEPRECATIONMACROS_H_

#ifndef __GMS_AVAILABLE_BUT_DEPRECATED
#define __GMS_AVAILABLE_BUT_DEPRECATED __deprecated
#endif

#ifndef __GMS_AVAILABLE_BUT_DEPRECATED_MSG
#define __GMS_AVAILABLE_BUT_DEPRECATED_MSG(msg) __deprecated_msg(msg)
#endif

#endif
3 changes: 3 additions & 0 deletions Frameworks/GoogleMapsBase.framework/Headers/GoogleMapsBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#import "GMSCompatabilityMacros.h"
#import "GMSCoordinateBounds.h"
#import "GMSDeprecationMacros.h"
1 change: 0 additions & 1 deletion Frameworks/GoogleMapsBase.framework/Modules

This file was deleted.

8 changes: 8 additions & 0 deletions Frameworks/GoogleMapsBase.framework/Modules/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
framework module GoogleMapsBase {
umbrella header "GoogleMapsBase.h"
export *
module * { export *}
link "z"
link framework "CoreLocation"
link framework "CoreTelephony"
link framework "Security"}
Binary file not shown.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Frameworks/GoogleMapsBase.framework/Versions/Current

This file was deleted.

1 change: 0 additions & 1 deletion Frameworks/GooglePlaces.framework/Headers

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN;

/**
* Represents a component of an address, e.g., street number, postcode, city, etc.
Expand All @@ -29,4 +29,4 @@ NS_ASSUME_NONNULL_BEGIN

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// GMSAutocompleteBoundsMode.h
// Google Places API for iOS
//
// Copyright 2017 Google Inc.
//
// Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
// Service: https://developers.google.com/maps/terms
//

/**
* \defgroup AutocompleteBoundsMode GMSAutocompleteBoundsMode
* @{
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN;

/**
* Specifies how autocomplete should interpret the |bounds| parameters.
*/
typedef NS_ENUM(NSUInteger, GMSAutocompleteBoundsMode) {
/** Interpret |bounds| as a bias. */
kGMSAutocompleteBoundsModeBias,
/** Interpret |bounds| as a restrict. */
kGMSAutocompleteBoundsModeRestrict
};

NS_ASSUME_NONNULL_END;

/**@}*/
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
#else
#import <GoogleMapsBase/GoogleMapsBase.h>
#endif
#import <GooglePlaces/GMSAutocompleteFilter.h>
#import "GMSAutocompleteBoundsMode.h"
#import "GMSAutocompleteFilter.h"

@class GMSAutocompletePrediction;

NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN;

/**
* Protocol for objects that can receive callbacks from GMSAutocompleteFetcher
Expand Down Expand Up @@ -54,21 +55,32 @@ NS_ASSUME_NONNULL_BEGIN
@interface GMSAutocompleteFetcher : NSObject

/**
* Initialise the fetcher
* @param bounds The bounds used to bias the results. This is not a hard restrict - places may still
* be returned outside of these bounds. This parameter may be nil.
* Initialize the fetcher.
*
* @param bounds The bounds used to bias or restrict the results. Whether this biases or restricts
* is determined by the value of the |autocompleteBoundsMode| property.
* This parameter may be nil.
* @param filter The filter to apply to the results. This parameter may be nil.
*/
- (instancetype)initWithBounds:(nullable GMSCoordinateBounds *)bounds
filter:(nullable GMSAutocompleteFilter *)filter
NS_DESIGNATED_INITIALIZER;
filter:(nullable GMSAutocompleteFilter *)filter NS_DESIGNATED_INITIALIZER;

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

/** Bounds used to bias the autocomplete search (can be nil). */
/**
* Bounds used to bias or restrict the autocomplete results depending on the value of
* |autocompleteBoundsMode| (can be nil).
*/
@property(nonatomic, strong, nullable) GMSCoordinateBounds *autocompleteBounds;

/**
* How to treat the |autocompleteBounds| property. Defaults to |kGMSAutocompleteBoundsModeBias|.
*
* Has no effect if |autocompleteBounds| is nil.
*/
@property(nonatomic, assign) GMSAutocompleteBoundsMode autocompleteBoundsMode;

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

Expand All @@ -86,4 +98,4 @@ NS_ASSUME_NONNULL_BEGIN

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END;
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN;

/**
* \defgroup PlacesAutocompleteTypeFilter GMSPlacesAutocompleteTypeFilter
* @{
*/

/**
* The type filters that may be applied to an autocomplete request to restrict results to different
Expand Down Expand Up @@ -51,6 +56,8 @@ typedef NS_ENUM(NSInteger, GMSPlacesAutocompleteTypeFilter) {
kGMSPlacesAutocompleteTypeFilterCity,
};

/**@}*/

/**
* This class represents a set of restrictions that may be applied to autocomplete requests. This
* allows customization of autocomplete suggestions to only those places that are of interest.
Expand All @@ -71,4 +78,4 @@ typedef NS_ENUM(NSInteger, GMSPlacesAutocompleteTypeFilter) {

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#import <Foundation/Foundation.h>

NS_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 @@ -32,4 +32,4 @@ NS_ASSUME_NONNULL_BEGIN

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END;
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
//


NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN;

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

Expand Down Expand Up @@ -79,4 +81,4 @@ extern NSString *const kGMSAutocompleteMatchAttribute;

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END;
Loading

0 comments on commit 07c295f

Please sign in to comment.