Skip to content

Commit

Permalink
- iOS: Handling multiple targets when sequence is started
Browse files Browse the repository at this point in the history
  • Loading branch information
prscms committed Jul 17, 2018
1 parent 0d2c0d6 commit f326d96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion ios/RNAppTour.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,29 @@ - (dispatch_queue_t)methodQueue {

RCT_EXPORT_METHOD(ShowSequence:(NSArray *)views props:(NSDictionary *)props)
{
targets = [[MutableOrderedDictionary alloc] init];
bool tourStarted = false;
if (targets == nil || [[targets allKeys] count] <= 0) {
targets = [[MutableOrderedDictionary alloc] init];
} else {
for (NSNumber *view in views) {
if (![targets objectForKey: [view stringValue]]) {
tourStarted = true;
}
}
}

for (NSNumber *view in views) {
[targets setObject:[props objectForKey: [view stringValue]] forKey: [view stringValue]];
}

if (tourStarted == true) return;
if ([[targets allKeys] count] <= 0) return;

NSString *showTargetKey = [ [targets allKeys] objectAtIndex: 0];
[self ShowFor:[NSNumber numberWithLongLong:[showTargetKey longLongValue]] props:[targets objectForKey:showTargetKey] ];
}


RCT_EXPORT_METHOD(ShowFor:(nonnull NSNumber *)view props:(NSDictionary *)props)
{
MaterialShowcase *materialShowcase = [self generateMaterialShowcase:view props:props];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-app-tour",
"version": "0.0.13",
"version": "0.0.15",
"description": "React Native: Native App Tour Library",
"repository": {
"type": "git",
Expand Down

0 comments on commit f326d96

Please sign in to comment.