mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-05-13 00:04:14 +08:00
Add helper categories to NSArray and NSSet
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// NSArray+Empty.h
|
||||
// OpenVPNAdapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 16/10/2018.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSArray (Empty)
|
||||
|
||||
@property (nonatomic, readonly) BOOL isNotEmpty;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// NSArray+Empty.m
|
||||
// OpenVPNAdapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 16/10/2018.
|
||||
//
|
||||
|
||||
#import "NSArray+Empty.h"
|
||||
|
||||
@implementation NSArray (Empty)
|
||||
|
||||
- (BOOL)isNotEmpty {
|
||||
return (self.count > 0) ? YES : NO;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// NSSet+Empty.h
|
||||
// OpenVPNAdapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 16/10/2018.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSSet (Empty)
|
||||
|
||||
@property (nonatomic, readonly) BOOL isNotEmpty;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// NSSet+Empty.m
|
||||
// OpenVPNAdapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 16/10/2018.
|
||||
//
|
||||
|
||||
#import "NSSet+Empty.h"
|
||||
|
||||
@implementation NSSet (Empty)
|
||||
|
||||
- (BOOL)isNotEmpty {
|
||||
return (self.count > 0) ? YES : NO;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user