Merge branch 'feature/model_cleanup' into 'develop'

Feature/model cleanup

See merge request BPHV_MIPS/mvm_core!75
This commit is contained in:
Pfeil, Scott Robert 2020-03-26 11:44:35 -04:00
commit 93657580aa
9 changed files with 12 additions and 12 deletions

View File

@ -70,7 +70,7 @@ static void * XXContext = &XXContext;
}
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy alertDelegate:(nullable NSObject <MVMCoreAlertDelegateProtocol>*)alertDelegate {
if ([self initWithAlert:alert isGreedy:isGreedy]) {
if (self = [self initWithAlert:alert isGreedy:isGreedy]) {
self.alertDelegate = alertDelegate;
}
return self;

View File

@ -41,7 +41,7 @@ NSUInteger const TopAlertDismissTime = 5;
// The default is yes if not sent by server (for legacy to work as is)
NSNumber *closeButton = [responseInfo optionalNumberForKey:KeyCloseButton];
if (closeButton) {
if (closeButton != nil) {
self.useCloseButton = [closeButton boolValue];
} else {
self.useCloseButton = YES;
@ -52,7 +52,7 @@ NSUInteger const TopAlertDismissTime = 5;
// Server driven dismiss time.
if (self.useNewStyle) {
NSNumber *topAlertTime = [responseInfo optionalNumberForKey:@"topAlertTime"];
if (topAlertTime) {
if (topAlertTime != nil) {
self.topAlertDismissTime = [topAlertTime integerValue];
}
}

View File

@ -152,7 +152,7 @@
}
NSTimeInterval timeOutInterval = 60;
if (requestParameters.customTimeoutTime) {
if (requestParameters.customTimeoutTime != nil) {
timeOutInterval = requestParameters.customTimeoutTime.floatValue;
} else if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(timeOutIntervalForRequest:)]) {
timeOutInterval = [[MVMCoreObject sharedInstance].globalLoadDelegate timeOutIntervalForRequest:requestParameters];

View File

@ -62,7 +62,7 @@
- (BOOL)extendsAppSession {
NSNumber *extendSessionFlag = [self.responseInfoMap optionalNumberForKey:@"appSessionExtended"];
return !extendSessionFlag || [extendSessionFlag boolValue]; // Default to YES if the key does not exist.
return extendSessionFlag == nil || [extendSessionFlag boolValue]; // Default to YES if the key does not exist.
}
#pragma mark - Deprecated

View File

@ -824,7 +824,7 @@
if (postCallsDict) {
NSArray *actionList = [postCallsDict array:@"actionList"];
//TODO needs to create operation queue based on concurrent flag
BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"];
//BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"];
//Needs further enhancements based on the flags.
BOOL shouldTriggerFromCache = [postCallsDict boolForKey:@"shouldTriggerFromCache"];
//Check if page is not from cache

View File

@ -220,7 +220,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
// Adds json to cache with page type key.
NSNumber *shouldCache = [jsonDictionary optionalNumberForKey:@"cache"];
if (!shouldCache || shouldCache.boolValue) {
if (shouldCache == nil || shouldCache.boolValue) {
[weakSelf.pageTypeCache setObject:jsonDictionary forKey:pageType];
}
}
@ -257,7 +257,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
// Adds json to cache with page type key.
NSNumber *shouldCache = [jsonDictionary optionalNumberForKey:@"cache"];
if (!shouldCache || shouldCache.boolValue) {
if (shouldCache == nil || shouldCache.boolValue) {
[weakSelf.moduleCache setObject:obj forKey:key];
}
}
@ -567,7 +567,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
if (isGif) {
[self checkImage:nil imageData:data fallbackImage:fallbackImageName completionHandler:completionHandler];
} else {
UIImage *image = [UIImage imageWithData:data scale:[UIScreen mainScreen].scale];
UIImage *image = data != nil ? [UIImage imageWithData:data scale:[UIScreen mainScreen].scale] : nil;
[self checkImage:image imageData:nil fallbackImage:fallbackImageName completionHandler:completionHandler];
}
}];

View File

@ -27,6 +27,6 @@
+ (BOOL)classIsInstanceTypeOfClass:(nonnull Class)theClass otherClass:(nonnull Class)otherClass throwException:(BOOL)throwException;
// Calls the above function with throw exception yes if the object is not nil. Returns the object. Convenience function for one liner in initializer.
+ (nonnull id)initializerClassCheck:(nullable NSObject *)object classToVerify:(nonnull Class)classToVerify;
+ (nullable id)initializerClassCheck:(nullable NSObject *)object classToVerify:(nonnull Class)classToVerify;
@end

View File

@ -53,7 +53,7 @@
NSInteger count = [dictionary count];
id __unsafe_unretained objects[count];
id __unsafe_unretained keys[count];
[dictionary getObjects:objects andKeys:keys];
[dictionary getObjects:objects andKeys:keys count:count];
for (NSUInteger i = 0; i < count; i++) {
id object = objects[i];
NSString *key = keys[i];

View File

@ -19,7 +19,7 @@
+ (void)performSyncBlockInBackground:(nonnull void (^)(void))block;
/// Ensures the block is peformed on the same *labeled* dispatch queue. The queue *must* be previously initialized with a unique label.
+ (void)performBlock:(nonnull void (^)(void))block onQueue:(dispatch_queue_t)queue;
+ (void)performBlock:(nonnull void (^)(void))block onQueue:(nonnull dispatch_queue_t)queue;
+ (void)performSyncBlock:(nonnull void (^)(void))block onQueue:(nonnull dispatch_queue_t)queue;
@end