From 03e0c447fbc6d0ba946370b923bfb543528ef71c Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Sat, 12 Sep 2020 11:22:33 +0200 Subject: MacGui: improve queue contextual menu items validation. --- macosx/NSArray+HBAdditions.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'macosx/NSArray+HBAdditions.m') diff --git a/macosx/NSArray+HBAdditions.m b/macosx/NSArray+HBAdditions.m index f24417632..1bea369a8 100644 --- a/macosx/NSArray+HBAdditions.m +++ b/macosx/NSArray+HBAdditions.m @@ -20,6 +20,18 @@ return YES; } +- (BOOL)containsWhere:(BOOL (^)(id object))block +{ + for (id object in self) + { + if (block(object) == YES) + { + return YES; + } + } + return NO; +} + - (NSArray *)filteredArrayUsingBlock:(BOOL (^)(id object))block { NSMutableArray *filteredArray = [NSMutableArray array]; -- cgit v1.2.3