From 2a8bd67f7e33a687501ea9e68922a5177b783ad3 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Thu, 13 Sep 2018 14:24:38 -0400 Subject: [PATCH 1/3] Fix nullabiilty. You must return an object for every element. --- MVMCore/MVMCore/Categories/NSArray+MFConvenience.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h b/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h index 73a9c89..667c307 100644 --- a/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h +++ b/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h @@ -38,6 +38,6 @@ - (nonnull NSString *)stringAtIndex:(NSUInteger)index; // Maps this array to a new array of T objects given a conversion block. Objective-C implementation of Swift's map. https://developer.apple.com/documentation/swift/array/2908681-map -- (nonnull NSArray *) map:(id _Nullable (^_Nonnull)(id _Nonnull obj))mapBlock; +- (nonnull NSArray *) map:(id _Nonnull (^_Nonnull)(id _Nonnull obj))mapBlock; @end From 5ccfb225be2a2814ece349911ce6584a06085925 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Thu, 13 Sep 2018 14:24:38 -0400 Subject: [PATCH 2/3] Fix nullabiilty. You must return an object for every element. --- MVMCore/MVMCore/Categories/NSArray+MFConvenience.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h b/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h index 481c332..02300dd 100644 --- a/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h +++ b/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h @@ -38,9 +38,9 @@ - (nonnull NSString *)stringAtIndex:(NSUInteger)index; // Maps this array to a new array of T objects given a conversion block. Objective-C implementation of Swift's map. https://developer.apple.com/documentation/swift/array/2908681-map -- (nonnull NSArray *)map:(id _Nullable (^_Nonnull)(id _Nonnull obj))mapBlock; -- (nonnull NSArray *)filter:(BOOL (^_Nullable)(id _Nonnull obj))block; +- (nonnull NSArray *)map:(id _Nonnull (^_Nonnull)(id _Nonnull obj))mapBlock; +- (nonnull NSArray *)filter:(BOOL (^_Nonnull)(id _Nonnull obj))block; - (nonnull id)reduce:(id _Nonnull)initial block:(id _Nonnull (^_Nonnull)(id _Nonnull obj1,id _Nonnull obj2))block; -- (nullable NSArray *)flatMap:(id _Nullable (^_Nonnull)(id _Nullable obj))block; +- (nonnull NSArray *)flatMap:(id _Nonnull (^_Nonnull)(id _Nullable obj))block; @end From a35f9a4df1f16d52066253c9ddfa0f68d789bfe6 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Thu, 13 Sep 2018 15:17:07 -0400 Subject: [PATCH 3/3] Fix flatMap spec. --- MVMCore/MVMCore/Categories/NSArray+MFConvenience.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h b/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h index 02300dd..8fb9036 100644 --- a/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h +++ b/MVMCore/MVMCore/Categories/NSArray+MFConvenience.h @@ -41,6 +41,6 @@ - (nonnull NSArray *)map:(id _Nonnull (^_Nonnull)(id _Nonnull obj))mapBlock; - (nonnull NSArray *)filter:(BOOL (^_Nonnull)(id _Nonnull obj))block; - (nonnull id)reduce:(id _Nonnull)initial block:(id _Nonnull (^_Nonnull)(id _Nonnull obj1,id _Nonnull obj2))block; -- (nonnull NSArray *)flatMap:(id _Nonnull (^_Nonnull)(id _Nullable obj))block; +- (nonnull NSArray *)flatMap:(id _Nonnull (^_Nonnull)(id _Nonnull obj))block; @end