Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit 49e3455

Browse files
lk23lekkladf2davidtruong
authored andcommitted
data must be imported as optional by Swift. (#43)
* data must be imported as optional by Swift. * Explicitly pass nil for clarity when invoking onFailure.
1 parent 7f35d5f commit 49e3455

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Iterable-iOS-SDK/IterableAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ typedef void (^OnSuccessHandler)(NSDictionary *data);
2121
/**
2222
The prototype for the completion handler block that gets called when an Iterable call fails
2323
*/
24-
typedef void (^OnFailureHandler)(NSString *reason, NSData *data);
24+
typedef void (^OnFailureHandler)(NSString *reason, NSData *_Nullable data);
2525

2626
/**
2727
Enum representing push platform; apple push notification service, production vs sandbox

Iterable-iOS-SDK/IterableAPI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ - (void)sendRequest:(NSURLRequest *)request onSuccess:(void (^)(NSDictionary *))
244244
if (onFailure != nil) onFailure(@"No data received", data);
245245
} else if (error != nil) {
246246
NSString *reason = [NSString stringWithFormat:@"%@", error];
247-
if (onFailure != nil) onFailure(reason, data);
247+
if (onFailure != nil) onFailure(reason, nil);
248248
}
249249
}];
250250
[task resume];

0 commit comments

Comments
 (0)