Created
December 17, 2014 13:12
-
-
Save noff/32ca70eaa88ea88c61d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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