-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add parsing for operating hour (#400)
* add parsing for operating hour * move to include * update dict value * bump patch * add test * bump beta * bump beta * remove beta tag
- Loading branch information
1 parent
6d25648
commit 3545c3c
Showing
12 changed files
with
142 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'RadarSDK' | ||
s.version = '3.18.1' | ||
s.version = '3.18.3' | ||
s.summary = 'iOS SDK for Radar, the leading geofencing and location tracking platform' | ||
s.homepage = 'https://radar.com' | ||
s.author = { 'Radar Labs, Inc.' => '[email protected]' } | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// RadarOperatingHour.h | ||
// RadarSDK | ||
// | ||
// Created by Kenny Hu on 10/7/24. | ||
// Copyright © 2024 Radar Labs, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface RadarOperatingHour : NSObject | ||
|
||
@property (nonatomic, strong, readonly) NSDictionary<NSString *, NSArray<NSArray<NSString *> *> *> *hours; | ||
|
||
@end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// RadarOperatingHour+Internal.h | ||
// RadarSDK | ||
// | ||
// Created by Kenny Hu on 10/7/24. | ||
// Copyright © 2024 Radar Labs, Inc. All rights reserved. | ||
// | ||
|
||
#import "RadarOperatingHour.h" | ||
|
||
@interface RadarOperatingHour() | ||
|
||
- (instancetype)initWithDictionary:(NSDictionary *)dictionary; | ||
|
||
@end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// RadarOperatingHour.m | ||
// RadarSDK | ||
// | ||
// Created by Kenny Hu on 10/7/24. | ||
// Copyright © 2024 Radar Labs, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "RadarOperatingHour+Internal.h" | ||
|
||
@implementation RadarOperatingHour | ||
|
||
- (instancetype)initWithDictionary:(NSDictionary *)dictionary { | ||
self = [super init]; | ||
if (self) { | ||
NSMutableDictionary *parsedHours = [NSMutableDictionary new]; | ||
|
||
for (NSString *key in dictionary) { | ||
id value = dictionary[key]; | ||
|
||
if ([value isKindOfClass:[NSArray class]]) { | ||
NSArray *dayPairs = (NSArray *)value; | ||
NSMutableArray *parsedDayPairs = [NSMutableArray new]; | ||
|
||
for (id pair in dayPairs) { | ||
if ([pair isKindOfClass:[NSArray class]] && [pair count] == 2) { | ||
NSString *start = pair[0]; | ||
NSString *end = pair[1]; | ||
|
||
if ([start isKindOfClass:[NSString class]] && [end isKindOfClass:[NSString class]]) { | ||
[parsedDayPairs addObject:@[start, end]]; | ||
} | ||
} | ||
} | ||
|
||
parsedHours[key] = [parsedDayPairs copy]; | ||
} | ||
} | ||
|
||
_hours = [parsedHours copy]; | ||
} | ||
return self; | ||
} | ||
|
||
@end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'RadarSDKMotion' | ||
s.version = '3.18.1' | ||
s.version = '3.18.3' | ||
s.summary = 'Motion detection plugin for RadarSDK, the leading geofencing and location tracking platform' | ||
s.homepage = 'https://radar.com' | ||
s.author = { 'Radar Labs, Inc.' => '[email protected]' } | ||
|
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
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