Skip to content

Instantly share code, notes, and snippets.

@noff
Created December 17, 2014 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noff/32ca70eaa88ea88c61d6 to your computer and use it in GitHub Desktop.
Save noff/32ca70eaa88ea88c61d6 to your computer and use it in GitHub Desktop.
//
// ViewController.m
// BunchTestObjectiveC
//
// Created by Михаил Кечинов on 16/12/14.
// Copyright (c) 2014 M.Kechinov's web-development studio, LLC. All rights reserved.
//
#import "ViewController.h"
#import "BNCHBunch.h"
#import "BNCHBunchManager.h"
#import "BNCHMutableBunch.h"
#import "BNCHBunchRegion.h"
#import "BNCHBunchDefinitions.h"
@interface ViewController () < BNCHBunchManagerDelegate >
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Create Manager
BNCHBunchManager *_bunchManager = [[BNCHBunchManager alloc]init];
// Set delegate
[_bunchManager setDelegate:self];
BNCHBunchRegion *region = [[BNCHBunchRegion alloc]initRegionWithIdentifier:@"BurgerKing"];
region.notifyEntryStateOnDisplay = YES;
region.notifyOnEntry = YES;
region.notifyOnExit = YES;
[_bunchManager startMonitoringForRegion:region];
[_bunchManager startRangingBunchesInRegion:region];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)bunchManager:(BNCHBunchManager *)manager didDetermineState:(CLRegionState)state forRegion:(BNCHBunchRegion *)region {
NSLog(@"Determined state");
}
-(void)bunchManager:(BNCHBunchManager *)manager didEnterRegion:(BNCHBunchRegion *)region {
NSLog(@"didEnterRegion");
}
-(void)bunchManager:(BNCHBunchManager *)manager didExitRegion:(BNCHBunchRegion *)region {
NSLog(@"didExitRegion");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment