1234567891011121314151617181920212223242526 |
- #import "RNNUtils.h"
-
- @implementation RNNUtils
- +(double)getDoubleOrKey:(NSDictionary*)dict withKey:(NSString*)key withDefault:(double)defaultResult {
- if ([dict objectForKey:key]) {
- return [dict[key] doubleValue];
- } else {
- return defaultResult;
- }
- }
- +(BOOL)getBoolOrKey:(NSDictionary*)dict withKey:(NSString*)key withDefault:(BOOL)defaultResult {
- if ([dict objectForKey:key]) {
- return [dict[key] boolValue];
- } else {
- return defaultResult;
- }
- }
- +(id)getObjectOrKey:(NSDictionary*)dict withKey:(NSString*)key withDefault:(id)defaultResult {
- if ([dict objectForKey:key]) {
- return dict[key];
- } else {
- return defaultResult;
- }
- }
- @end
|