Skip to content

LBLocation class will help you get the user location very easy and make forward and reverse geocoding.

License

Notifications You must be signed in to change notification settings

lucianboboc/LBLocation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LBLocation

LBLocation class will help you get the user location very easy and make forward and reverse geocoding.

How to use LBLocation class into your project

Import CoreLocation, MapKit and AddressBookUI frameworks.

Create the LBLocation object using initWithLocationUpdateBlock:.

The completionBlock will be called with the CLLocation value or, in case of error the completionBlock is called with a nil value.

The LBLocation class uses NSNotificationCenter and calls the startLocationServices method when the UIApplicationDidBecomeActiveNotification notification is received. It also calls the stopLocationServices when the UIApplicationWillResignActiveNotification notification is received.

EXAMPLE

     __weak ViewController *weakSelf = self;
    self.location = [[LBLocation alloc] initWithLocationUpdateBlock:^(CLLocation *location) {
        weakSelf.myLocation = location;
    }];

Reverse Geocoding

You can use reverseGeocodeCurrentLocationWithCompletionBlock: and reverseGeocodeLocation:completionBlock: methods and the completion block will be called with a CLPlacemark object or nil value.

You can get a string with the address from the CLPlacemark object using the addressStringFromPlacemark: method.

Forward Geocoding

You can use the geocodeAddressString:completionBlock: and geocodeAddressDictionary:completionBlock: methods,pass a string or dictionary with the address and the completion block will be called with a CLLocation object or nil value.

LICENSE

This content is released under the MIT License https://github.com/lucianboboc/LBLocation/blob/master/LICENSE.md

Enjoy!

About

LBLocation class will help you get the user location very easy and make forward and reverse geocoding.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published