Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Marcin Iwanicki committed Mar 20, 2016
2 parents 7db4770 + 571f669 commit 990ea0f
Show file tree
Hide file tree
Showing 52 changed files with 1,897 additions and 1,424 deletions.
6 changes: 6 additions & 0 deletions Bin/run-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ ! -d Source ]; then
cd ..
fi
cd Source
xctool build -project OCGoogleDirectionsAPI.xcodeproj -scheme OCGoogleDirectionsAPI -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
6 changes: 6 additions & 0 deletions Bin/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ ! -d Source ]; then
cd ..
fi
cd Source
xctool test -project OCGoogleDirectionsAPI.xcodeproj -scheme OCGoogleDirectionsAPITests -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# OCGoogleDirectionsAPI CHANGELOG

## 0.1.0
## 0.1.5

Initial release.
- Added scripts to build and run tests (Bin/run-build.sh, Bin/run-tests.sh)
- Added fare and duration_in_traffic to response
- Added transit_mode, transit_routing_preference, traffic_model, arrival_time,
departure_time to request

## 0.1.2

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

## 0.1.1

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

## 0.1.0

## 0.1.2

- Fixed copy-paste error of kCGGoogleDirectionsResponseAttributeBounds. (thanks @djmadcat)
Initial release.
4 changes: 2 additions & 2 deletions OCGoogleDirectionsAPI.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "OCGoogleDirectionsAPI"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "A lightweight wrapper for The Google Directions API."
s.homepage = "https://github.com/marciniwanicki/OCGoogleDirectionsAPI"
s.license = 'MIT'
s.author = { "Marcin Iwanicki" => "marcin.iwanicki@appliwings.com" }
s.source = { :git => "https://github.com/marciniwanicki/OCGoogleDirectionsAPI.git", :tag => "0.1.4" }
s.source = { :git => "https://github.com/marciniwanicki/OCGoogleDirectionsAPI.git", :tag => "0.1.5" }

s.ios.deployment_target = '7.0'
s.requires_arc = true
Expand Down
53 changes: 38 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ As Google wrote:
<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>


# 0.1.4
# 0.1.5

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>.

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

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

+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationLocation:(CLLocation *)destination sensor:(BOOL)sensor;

+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationLocation:(CLLocation *)destination;

+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationLocation:(CLLocation *)destination sensor:(BOOL)sensor;

+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationString:(NSString *)destination;

+ (instancetype)requestWithOriginLocation:(CLLocation *)origin andDestinationString:(NSString *)destination sensor:(BOOL)sensor;

+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationString:(NSString *)destination;

+ (instancetype)requestWithOriginString:(NSString *)origin andDestinationString:(NSString *)destination sensor:(BOOL)sensor;
```

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

### Traffic model

```objc
[request setTrafficModel:OCDirectionsRequestTrafficModelOptimistic];
```
### Transit mode
```objc
[request setTransitMode:OCDirectionsRequestTransitModeBus | OCDirectionsRequestTransitModeTrain];
```

### Transit routing preference

```objc
[request setTransitRoutingPreference:OCDirectionsRequestTransitRoutingPreferenceFewerTransfers];
```
## Response
Expand All @@ -188,6 +199,7 @@ Classes:
* [OCDirectionsDuration](#ocdirectionsduration)
* [OCDirectionsStep](#ocdirectionsstep)
* [OCDirectionsWaypoint](#ocdirectionswaypoint)
* [OCDirectionsFare](#ocdirectionsfare)
### OCDirectionsResponse
Expand All @@ -199,6 +211,7 @@ Properties:
* errorMessage `NSString*`
* route `NSDirectionsRoute*`
Be aware that `geocoded_waypoints` property is not supported in the current version (#8).
### OCDirectionsResponseStatus
Expand Down Expand Up @@ -233,6 +246,7 @@ Properties:
* dictionary `NSDictionary*`
* distance `OCDirectionsDistance*`
* duration `OCDirectionsDuration*`
* durationInTraffic `OCDirectionsDuration*`
* endAddress `NSString*`
* endLocation `OCLocationCoordinate2D`
* startAddress `NSString*`
Expand Down Expand Up @@ -262,9 +276,9 @@ Properties:
* dictionary `NSDictionary*`
* text `NSString*`
* value `NSNumber*`

### OCDirectionsDuration
### OCDirectionsDuration
Properties:
* dictionary `NSDictionary*`
Expand Down Expand Up @@ -295,11 +309,20 @@ Properties:
* stepInterpolation `NSNumber*`
### OCDirectionsFare
Properties:
* dictionary `NSDictionary*`
* currency `NSString*`
* text `NSString*`
* value `NSNumber*`
## Contact
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.
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.
## To Do
## TODO
* Add samples.
* Write unit tests.
Expand Down
148 changes: 0 additions & 148 deletions Rakefile

This file was deleted.

Loading

0 comments on commit 990ea0f

Please sign in to comment.