Platformsios 7.0, requires ARC

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.


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;


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

@protocol QKGeofenceManagerDataSource <NSObject>

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


and to deliver inside/exit events.

@protocol QKGeofenceManagerDelegate <NSObject>

- (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;


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.


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.


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.


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": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Eric Webster": "[email protected]"
    "platforms": {
        "ios": "7.0"
    "source": {
        "git": "",
        "tag": "v1.2.4"
    "source_files": "QKGeofenceManager/*.{h,m}",
    "requires_arc": true

Pin It on Pinterest

Share This