Skip to content

Commit 990ea0f

Browse files
author
Marcin Iwanicki
committed
Merge branch 'develop'
* develop: Update README. Update README and podspec. Update CHANGELOG. Fix typo. Use more restrictive build flags. Fix project issues. Add fare to response. Add duration_in_traffic to response. Add transit_routing_preference parameter to request. Add traffic_model parameter to request. Add transit_mode parameter to request. Add arrival_time and departure_time parameters to request object. Fix missing units parameter. Format properties. Remove property attributes which are not needed anymore. Format code and optimised imports.
2 parents 7db4770 + 571f669 commit 990ea0f

File tree

52 files changed

+1897
-1424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1897
-1424
lines changed

Bin/run-build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
if [ ! -d Source ]; then
3+
cd ..
4+
fi
5+
cd Source
6+
xctool build -project OCGoogleDirectionsAPI.xcodeproj -scheme OCGoogleDirectionsAPI -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO

Bin/run-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
if [ ! -d Source ]; then
3+
cd ..
4+
fi
5+
cd Source
6+
xctool test -project OCGoogleDirectionsAPI.xcodeproj -scheme OCGoogleDirectionsAPITests -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO

CHANGELOG.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# OCGoogleDirectionsAPI CHANGELOG
22

3-
## 0.1.0
3+
## 0.1.5
44

5-
Initial release.
5+
- Added scripts to build and run tests (Bin/run-build.sh, Bin/run-tests.sh)
6+
- Added fare and duration_in_traffic to response
7+
- Added transit_mode, transit_routing_preference, traffic_model, arrival_time,
8+
departure_time to request
9+
10+
## 0.1.2
611

12+
- Fixed copy-paste error of kCGGoogleDirectionsResponseAttributeBounds. (thanks @djmadcat)
713

814
## 0.1.1
915

1016
- Fixed init method to initialise locationString property properly.
1117
- Fixed missing summary parsing. (thanks @DmitryPR)
1218

19+
## 0.1.0
1320

14-
## 0.1.2
15-
16-
- Fixed copy-paste error of kCGGoogleDirectionsResponseAttributeBounds. (thanks @djmadcat)
21+
Initial release.

OCGoogleDirectionsAPI.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = "OCGoogleDirectionsAPI"
3-
s.version = "0.1.4"
3+
s.version = "0.1.5"
44
s.summary = "A lightweight wrapper for The Google Directions API."
55
s.homepage = "https://github.com/marciniwanicki/OCGoogleDirectionsAPI"
66
s.license = 'MIT'
77
s.author = { "Marcin Iwanicki" => "[email protected]" }
8-
s.source = { :git => "https://github.com/marciniwanicki/OCGoogleDirectionsAPI.git", :tag => "0.1.4" }
8+
s.source = { :git => "https://github.com/marciniwanicki/OCGoogleDirectionsAPI.git", :tag => "0.1.5" }
99

1010
s.ios.deployment_target = '7.0'
1111
s.requires_arc = true

README.md

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ As Google wrote:
77
<i>"The Google Directions API is a service that calculates directions between locations using an HTTP request. You can search for directions for several modes of transportation, include transit, driving, walking or cycling. Directions may specify origins, destinations and waypoints either as text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia") or as latitude/longitude coordinates. The Directions API can return multi-part directions using a series of waypoints."</i>
88

99

10-
# 0.1.4
10+
# 0.1.5
1111

1212
The OCGoogleDirectionsAPI library allows your iOS apps to deal with this powerful service easily. <b>IMPORTANT:</b> It uses `NSURLSession` only available in iOS 7.0+. It is <b>not compatible with iOS 6.x and lower</b>.
1313

@@ -18,7 +18,7 @@ The OCGoogleDirectionsAPI library allows your iOS apps to deal with this powerfu
1818
#### Podfile
1919
```ruby
2020
platform :ios, '7.0'
21-
pod "OCGoogleDirectionsAPI", "~> 0.1.4"
21+
pod "OCGoogleDirectionsAPI", "~> 0.1.5"
2222
```
2323

2424
## How to get started
@@ -87,19 +87,11 @@ To create an isntance of `OCDirectionsRequest` you can use one of the following
8787
```objc
8888
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationLocation:(CLLocation *)destination;
8989

90-
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationLocation:(CLLocation *)destination sensor:(BOOL)sensor;
91-
9290
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationLocation:(CLLocation *)destination;
9391

94-
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationLocation:(CLLocation *)destination sensor:(BOOL)sensor;
95-
9692
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationString:(NSString *)destination;
9793

98-
+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationString:(NSString *)destination sensor:(BOOL)sensor;
99-
10094
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationString:(NSString *)destination;
101-
102-
+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationString:(NSString *)destination sensor:(BOOL)sensor;
10395
```
10496

10597
### Request attributes
@@ -127,7 +119,7 @@ Here you can find the list of supported languages: [https://developers.google.co
127119
There are 3 different restrictions:
128120
* `OCDirectionsRequestRestrictionAvoidTolls`
129121
* `OCDirectionsRequestRestrictionAvoidHighways`
130-
* `OCDirectionsRequestRestrictionAviodFerries`
122+
* `OCDirectionsRequestRestrictionAvoidFerries`
131123
132124
133125
You can ask to avoid one or even all of them by calling the `setRestrictions:` method.
@@ -174,6 +166,25 @@ CLLocation *secondLocation = [[CLLocation alloc] initWithLatitude:51.1314 longit
174166
[request setWaypointsOptimise:YES];
175167
```
176168

169+
### Traffic model
170+
171+
```objc
172+
[request setTrafficModel:OCDirectionsRequestTrafficModelOptimistic];
173+
```
174+
175+
### Transit mode
176+
177+
```objc
178+
[request setTransitMode:OCDirectionsRequestTransitModeBus | OCDirectionsRequestTransitModeTrain];
179+
```
180+
181+
### Transit routing preference
182+
183+
```objc
184+
[request setTransitRoutingPreference:OCDirectionsRequestTransitRoutingPreferenceFewerTransfers];
185+
```
186+
187+
177188
178189
## Response
179190
@@ -188,6 +199,7 @@ Classes:
188199
* [OCDirectionsDuration](#ocdirectionsduration)
189200
* [OCDirectionsStep](#ocdirectionsstep)
190201
* [OCDirectionsWaypoint](#ocdirectionswaypoint)
202+
* [OCDirectionsFare](#ocdirectionsfare)
191203
192204
193205
### OCDirectionsResponse
@@ -199,6 +211,7 @@ Properties:
199211
* errorMessage `NSString*`
200212
* route `NSDirectionsRoute*`
201213
214+
Be aware that `geocoded_waypoints` property is not supported in the current version (#8).
202215
203216
### OCDirectionsResponseStatus
204217
@@ -233,6 +246,7 @@ Properties:
233246
* dictionary `NSDictionary*`
234247
* distance `OCDirectionsDistance*`
235248
* duration `OCDirectionsDuration*`
249+
* durationInTraffic `OCDirectionsDuration*`
236250
* endAddress `NSString*`
237251
* endLocation `OCLocationCoordinate2D`
238252
* startAddress `NSString*`
@@ -262,9 +276,9 @@ Properties:
262276
* dictionary `NSDictionary*`
263277
* text `NSString*`
264278
* value `NSNumber*`
279+
265280
266-
267-
### OCDirectionsDuration
281+
### OCDirectionsDuration
268282
269283
Properties:
270284
* dictionary `NSDictionary*`
@@ -295,11 +309,20 @@ Properties:
295309
* stepInterpolation `NSNumber*`
296310
297311
312+
### OCDirectionsFare
313+
314+
Properties:
315+
* dictionary `NSDictionary*`
316+
* currency `NSString*`
317+
* text `NSString*`
318+
* value `NSNumber*`
319+
320+
298321
## Contact
299322
300-
Did you find a bug? Do you have great ideas how to make the library better? or you just want to say hello:) ... please do not hesitate to contact me via mail marcin.iwanicki[at]live.com or twitter @marciniwanicki.
323+
Did you find a bug? Do you have great ideas how to make the library better? or you just want to say hello:) ... drop me a line on twitter @marciniwanicki.
301324
302-
## To Do
325+
## TODO
303326
304327
* Add samples.
305328
* Write unit tests.

Rakefile

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)