Latest1.2.4
Homepagehttps://github.com/QuantumKing/QKGeofenceManager
LicenseMIT
Platformsios 7.0, requires ARC
Authors

Sets out to improve CoreLocation‘s region monitoring by increasing the limit of regions from 20 to (theoretically) unlimited. It also helps by covering some of the boilerplate error handling to make region monitoring a smoother experience.

Usage

QKGeofenceManager has the following interface:

@interface QKGeofenceManager : NSObject<CLLocationManagerDelegate>

@property (nonatomic, weak) id<QKGeofenceManagerDelegate> delegate;
@property (nonatomic, weak) id<QKGeofenceManagerDataSource> dataSource;
@property (nonatomic, readonly) QKGeofenceManagerState state;

+ (instancetype)sharedGeofenceManager;

- (void)reloadGeofences;

@end

It uses the dataSource/delegate pattern to provide an array of CLCircularRegions

@protocol QKGeofenceManagerDataSource <NSObject>

@required
- (NSArray *)geofencesForGeofenceManager:(QKGeofenceManager *)geofenceManager;

@end

and to deliver inside/exit events.

@protocol QKGeofenceManagerDelegate <NSObject>

@optional
- (void)geofenceManager:(QKGeofenceManager *)geofenceManager isInsideGeofence:(CLRegion *)geofence;
- (void)geofenceManager:(QKGeofenceManager *)geofenceManager didExitGeofence:(CLRegion *)geofence;
- (void)geofenceManager:(QKGeofenceManager *)geofenceManager didChangeState:(QKGeofenceManagerState)state;
- (void)geofenceManager:(QKGeofenceManager *)geofenceManager didFailWithError:(NSError *)error;

@end

QKGeofenceManager calls geofenceManager:isInsideGeofence: when the user enters or is currently inside the geofence. geofenceManager:didChangeState: is called when the manager changes from one of three states: QKGeofenceManagerStateIdle, QKGeofenceManagerStateProcessing and QKGeofenceManagerStateFailed.

Demo

The demo provided allows a user to add geofences and display them in a table view. When the refresh button is pressed, QKGeofenceManager does its magic and determines which geofences the user is inside. Moving in and out of geofences will update the table view accordingly.

QKGeofenceManager

It is also possible to edit a geofence (which is by default at the current location) by selecting it in the table view and then dragging the marker around on the map.

QKGeofenceManager

Installation via Cocoapods

Add pod 'QKGeofenceManager', '~> 1.1' to your Podfile and run pod to install.

Latest podspec

{
    "name": "QKGeofenceManager",
    "version": "1.2.4",
    "summary": "Geofencing library for iOS. Unlimited region monitoring.",
    "description": "                   A longer description of QKForms in Markdown format.nn                   * Think: Why did you write this? What is the focus? What does it do?n                   * CocoaPods will be using this to generate tags, and improve search results.n                   * Try to keep it short, snappy and to the point.n                   * Finally, don't worry about the indent, CocoaPods strips it!n",
    "homepage": "https://github.com/QuantumKing/QKGeofenceManager",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Eric Webster": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/QuantumKing/QKGeofenceManager.git",
        "tag": "v1.2.4"
    },
    "source_files": "QKGeofenceManager/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This