Skip to content

Commit

Permalink
Moving BBFenceInfo class inside BBLocationManager, so that its easy t…
Browse files Browse the repository at this point in the history
…o find everything on one place.
  • Loading branch information
Benzamin Basher authored and Benzamin Basher committed Mar 16, 2017
1 parent 373d1d3 commit 25c15fe
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 66 deletions.
6 changes: 0 additions & 6 deletions BBLocationManager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
4B7EC43C1E3DF6110038CA09 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B7EC43B1E3DF6110038CA09 /* Assets.xcassets */; };
4B7EC43F1E3DF6110038CA09 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B7EC43D1E3DF6110038CA09 /* LaunchScreen.storyboard */; };
4B7EC44A1E3DF6120038CA09 /* BBLocationManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B7EC4491E3DF6120038CA09 /* BBLocationManagerTests.m */; };
4B7EC4581E3E1A470038CA09 /* BBFenceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B7EC4541E3E1A470038CA09 /* BBFenceInfo.m */; };
4B7EC4591E3E1A470038CA09 /* BBLocationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B7EC4561E3E1A470038CA09 /* BBLocationManager.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -44,8 +43,6 @@
4B7EC4451E3DF6120038CA09 /* BBLocationManagerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BBLocationManagerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4B7EC4491E3DF6120038CA09 /* BBLocationManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BBLocationManagerTests.m; sourceTree = "<group>"; };
4B7EC44B1E3DF6120038CA09 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4B7EC4541E3E1A470038CA09 /* BBFenceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BBFenceInfo.m; path = BBLocationManagerClasses/BBFenceInfo.m; sourceTree = "<group>"; };
4B7EC4551E3E1A470038CA09 /* BBFenceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BBFenceInfo.h; path = BBLocationManagerClasses/BBFenceInfo.h; sourceTree = "<group>"; };
4B7EC4561E3E1A470038CA09 /* BBLocationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BBLocationManager.m; path = BBLocationManagerClasses/BBLocationManager.m; sourceTree = "<group>"; };
4B7EC4571E3E1A470038CA09 /* BBLocationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BBLocationManager.h; path = BBLocationManagerClasses/BBLocationManager.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -124,8 +121,6 @@
4B7EC45A1E3E1A4F0038CA09 /* BBLocationManagerClasses */ = {
isa = PBXGroup;
children = (
4B7EC4551E3E1A470038CA09 /* BBFenceInfo.h */,
4B7EC4541E3E1A470038CA09 /* BBFenceInfo.m */,
4B7EC4571E3E1A470038CA09 /* BBLocationManager.h */,
4B7EC4561E3E1A470038CA09 /* BBLocationManager.m */,
);
Expand Down Expand Up @@ -234,7 +229,6 @@
buildActionMask = 2147483647;
files = (
4B7EC4371E3DF6110038CA09 /* ViewController.m in Sources */,
4B7EC4581E3E1A470038CA09 /* BBFenceInfo.m in Sources */,
4B7EC4341E3DF6110038CA09 /* AppDelegate.m in Sources */,
4B7EC4591E3E1A470038CA09 /* BBLocationManager.m in Sources */,
4B7EC4311E3DF6110038CA09 /* main.m in Sources */,
Expand Down
39 changes: 0 additions & 39 deletions BBLocationManager/BBLocationManagerClasses/BBFenceInfo.h

This file was deleted.

20 changes: 0 additions & 20 deletions BBLocationManager/BBLocationManagerClasses/BBFenceInfo.m

This file was deleted.

33 changes: 32 additions & 1 deletion BBLocationManager/BBLocationManagerClasses/BBLocationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,38 @@

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "BBFenceInfo.h"

#define BB_FENCE_EVENT_TYPE_KEY @"BBeventType"
#define BB_FENCE_EVENT_TIMESTAMP_KEY @"BBeventTimeStamp"
#define BB_FENCE_IDENTIFIER_KEY @"BBfenceIDentifier"
#define BB_FENCE_COORDINATE_KEY @"BBfenceCoordinate"

#define BB_GET_FENCE_EVENT_STRING(fenceEventTypeEnum) [@[ @"BBFenceEventAdded", @"BBFenceEventRemoved",@"BBFenceEventFailed", @"BBFenceEventRepeated", @"BBFenceEventEnterFence",@"BBFenceEventExitFence", @"BBFenceEventNone"] objectAtIndex:(fenceEventTypeEnum)]

typedef enum : NSUInteger {
BBFenceEventTypeAdded,
BBFenceEventTypeRemoved,
BBFenceEventTypeFailed,
BBFenceEventTypeRepeated,
BBFenceEventTypeEnterFence,
BBFenceEventTypeExitFence,
BBFenceEventTypeNone
} BBFenceEventType;

@interface BBFenceInfo : NSObject


@property(nonatomic, assign) NSString *eventType;
@property(nonatomic, strong) NSString *eventTimeStamp;
@property(nonatomic, strong) NSString *fenceIDentifier;
@property(nonatomic, strong) NSDictionary *fenceCoordinate;//uses BB_LATITUDE, BB_LONGITUDE, BB_RADIOUS to wrap data

- (NSDictionary*)dictionary;



@end


#define BB_DEFAULT_FENCE_RADIOUS 100.0f
#define BB_LATITUDE @"latitude"
Expand Down
13 changes: 13 additions & 0 deletions BBLocationManager/BBLocationManagerClasses/BBLocationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -797,3 +797,16 @@ -(NSString*)currentTimeStampWithFormat:(NSString*)format


@end

@implementation BBFenceInfo

- (NSDictionary *)dictionary
{
return @{ BB_FENCE_EVENT_TYPE_KEY : self.eventType ? _eventType : [NSNull null],
BB_FENCE_EVENT_TIMESTAMP_KEY : self.eventTimeStamp ? _eventTimeStamp : [NSNull null],
BB_FENCE_IDENTIFIER_KEY : self.fenceIDentifier ? _fenceIDentifier : [NSNull null],
BB_FENCE_COORDINATE_KEY : self.fenceCoordinate ? _fenceCoordinate : [NSNull null] };

}
@end

0 comments on commit 25c15fe

Please sign in to comment.