Latest 1.0.0
Homepage https://github.com/lminhtm/LMDistanceCalculator
License MIT
Platforms ios 7.0, requires ARC
Authors

LMDistanceCalculator is a simple wrapper for calculating geometry and real distance between any locations on Earth.

LMDistanceCalculator

Features

  • Wrapper for calculating geometry and real distance with blocked-based coding.
  • Using Google Distance Matrix API.

Requirements

  • iOS 7.0 or higher
  • ARC

Installation

From CocoaPods

pod 'LMDistanceCalculator'

Manually

  • Drag the LMDistanceCalculator folder into your project.
  • Add the CoreLocation.framework to your project.
  • Add #import "LMDistanceCalculator.h" to the top of classes that will use it.

Usage

Geometry Distance

CGFloat geometryDistance = [LMDistanceCalculator geometryDistanceFromOrigin:origin destination:destination];
NSLog(@"Geometry Distance: %f", geometryDistance);

Real Distance

[[LMDistanceCalculator sharedInstance] realDistanceFromOrigin:origin
                                                  destination:destination
                                            completionHandler:^(NSNumber * _Nullable result, NSError * _Nullable error) {
                                                if (result && !error) {
                                                    NSLog(@"Real Distance: %f", [result doubleValue]);
                                                }
                                            }];

See sample Xcode project in /LMDistanceCalculatorDemo

License

LMDistanceCalculator is licensed under the terms of the MIT License.

Contact

Minh Luong Nguyen

Latest podspec

{
    "name": "LMDistanceCalculator",
    "version": "1.0.0",
    "summary": "LMDistanceCalculator is a simple wrapper for calculating geometry and real distance between locations on Earth.",
    "homepage": "https://github.com/lminhtm/LMDistanceCalculator",
    "platforms": {
        "ios": "7.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE.txt"
    },
    "authors": {
        "LMinh": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lminhtm/LMDistanceCalculator.git",
        "tag": "1.0.0"
    },
    "source_files": "LMDistanceCalculator/*.{m,h}",
    "requires_arc": true
}

Pin It on Pinterest

Share This