Adds StringHelper with isStringNilOrEmpty method.

This commit is contained in:
2020-09-05 19:06:39 -07:00
parent 1e1abba82f
commit 473fa15f7c
3 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
//
// StringHelper.h
// MonsterCards
//
// Created by Tom Hicks on 9/5/20.
// Copyright © 2020 Tom Hicks. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface StringHelper : NSObject
+(BOOL)isStringNilOrEmpty:(NSString*)theString;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,25 @@
//
// StringHelper.m
// MonsterCards
//
// Created by Tom Hicks on 9/5/20.
// Copyright © 2020 Tom Hicks. All rights reserved.
//
#import "StringHelper.h"
@implementation StringHelper
+(BOOL)isStringNilOrEmpty:(NSString*)theString {
if (nil == theString) {
return YES;
}
if (theString.length < 1) {
return YES;
}
return NO;
}
@end