From 7fdff34eeb1ba962bff869297fde964d6bda774a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 24 Mar 2020 09:54:18 -0400 Subject: [PATCH] Warning and analyze fixes --- .../MVMCoreUISplitViewController.m | 3 +-- .../MVMCoreUITabBarPageControlViewController.m | 2 +- MVMCoreUI/Legacy/Controllers/MFViewController.h | 3 --- MVMCoreUI/Legacy/Controllers/MFViewController.m | 17 ----------------- .../TopLabelsAndBottomButtonsViewController.m | 15 ++++++++------- MVMCoreUI/Legacy/Views/MFCaretButton.m | 6 +++--- MVMCoreUI/Legacy/Views/MFCaretView.m | 2 +- MVMCoreUI/Legacy/Views/MFRadioButton.h | 8 ++++---- MVMCoreUI/Legacy/Views/MFTextField.h | 4 ---- MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m | 6 +++--- MVMCoreUI/Legacy/Views/SeparatorView.h | 3 --- .../TopAlert/MVMCoreUITopAlertExpandableView.m | 8 ++++---- MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m | 14 +++++++------- MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m | 2 +- MVMCoreUI/Utility/MVMCoreUIUtility.m | 2 +- MVMCoreUI/Utility/Sizing/MFSizeObject.m | 2 +- 16 files changed, 35 insertions(+), 62 deletions(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 44642f3a..476e7264 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -100,7 +100,7 @@ CGFloat const PanelAnimationDuration = 0.2; - (MFNumberOfDrawers)numberOfDrawersShouldShow:(NSNumber *)forWidth { CGFloat width; - if (forWidth) { + if (forWidth != nil) { width = [forWidth floatValue]; } else { width = [MVMCoreUISplitViewController getApplicationViewWidth]; @@ -814,7 +814,6 @@ CGFloat const PanelAnimationDuration = 0.2; // The main view. NavigationController *navigationController = [NavigationController setupNavigationController]; self.navigationController = navigationController; - self.automaticallyAdjustsScrollViewInsets = NO; UIView *mainView = navigationController.view; mainView.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m b/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m index d700e57f..1df6bd67 100644 --- a/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m +++ b/MVMCoreUI/Containers/TabBarController/MVMCoreUITabBarPageControlViewController.m @@ -181,7 +181,7 @@ __block NSInteger currentIndex = NSNotFound; if (!self.loadObject.pageDataFromCache) { NSNumber *currentIndexNumber = [self.loadObject.pageJSON optionalNumberForKey:@"currentTabIndex"]; - if (currentIndexNumber) { + if (currentIndexNumber != nil) { currentIndex = [currentIndexNumber integerValue]; } } diff --git a/MVMCoreUI/Legacy/Controllers/MFViewController.h b/MVMCoreUI/Legacy/Controllers/MFViewController.h index 38ced354..cd96a07f 100644 --- a/MVMCoreUI/Legacy/Controllers/MFViewController.h +++ b/MVMCoreUI/Legacy/Controllers/MFViewController.h @@ -96,9 +96,6 @@ // This view controller should subclass this function and check the load to make sure it has all the needed data. Fills the error object if there are any errors. Returns if we should finish the load or not. - (BOOL)shouldFinishProcessingLoad:(nonnull MVMCoreLoadObject *)loadObject error:(MVMCoreErrorObject *_Nonnull *_Nonnull)error; -/// Called in newDataBuildScreen. Can override to parse the json into a model object. -- (void)parsePageJSON:(NSError * _Nullable * _Nullable)error; - // Sets the screen to use the screen heading. // it is required in device flow, where we are showing greeting name as screen heading, // device details screen heading needs to be updated/refreshed again, if user has changed device nick name diff --git a/MVMCoreUI/Legacy/Controllers/MFViewController.m b/MVMCoreUI/Legacy/Controllers/MFViewController.m index 52cf01cf..febb14cf 100644 --- a/MVMCoreUI/Legacy/Controllers/MFViewController.m +++ b/MVMCoreUI/Legacy/Controllers/MFViewController.m @@ -88,25 +88,10 @@ self.pageType = loadObject.pageType; self.loadObject = loadObject; - NSError *parseError = nil; - [self parsePageJSON:&parseError]; - if (parseError) { - if (error) { - MVMCoreErrorObject *errorObject = [MVMCoreErrorObject createErrorObjectForNSError:parseError location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]; - errorObject.messageToDisplay = [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; - *error = errorObject; - } - return false; - } - // Verifies all modules needed are loaded. return [MFViewController verifyRequiredModulesLoadedForLoadObject:loadObject error:error]; } -- (void)parsePageJSON:(NSError * _Nullable * _Nullable)error { - -} - // Sets the screen to use the screen heading. // it is required in device flow, where we are showing greeting name as screen heading, // device details screen heading needs to be updated/refreshed again, if user has changed device nick name @@ -255,8 +240,6 @@ - (BOOL)newPageLoaded:(nonnull NSDictionary *)page { self.loadObject.pageJSON = page; - NSError *parseError = nil; - [self parsePageJSON:&parseError]; return YES; } diff --git a/MVMCoreUI/Legacy/Controllers/TopLabelsAndBottomButtonsViewController.m b/MVMCoreUI/Legacy/Controllers/TopLabelsAndBottomButtonsViewController.m index 5998c5da..f99bce31 100644 --- a/MVMCoreUI/Legacy/Controllers/TopLabelsAndBottomButtonsViewController.m +++ b/MVMCoreUI/Legacy/Controllers/TopLabelsAndBottomButtonsViewController.m @@ -35,8 +35,8 @@ @property (strong, nonatomic) UIView *topAccessoryView; // Adds the button view to the screen. Out of the scroll or in. -- (void)addViewOutsideOfScrollView:(UIView *)bottomView; -- (void)addViewToContentView:(UIView *)bottomView; +- (void)addViewOutsideOfScrollView:(nonnull UIView *)bottomView; +- (void)addViewToContentView:(nonnull UIView *)bottomView; @end @@ -133,8 +133,7 @@ self.topConstraintForTopView.active = YES; // Checks if we are using a different object than the bottom buttons. UIView *bottomView = [self useCustomViewInsteadOfButtons]; - self.customBottemView = (bottomView != nil); - if (!self.customBottemView) { + if (bottomView == nil) { // Sets up the buttons/button. NSDictionary *primaryButtonDictionary = [self primaryButtonMap]; @@ -144,8 +143,10 @@ self.primaryButton = buttonView.primaryButton; bottomView = buttonView; self.bottomView = bottomView; + self.customBottemView = NO; } else { self.bottomView = bottomView; + self.customBottemView = YES; } [self updateTopLabelsBottomButtonsPadding]; @@ -220,7 +221,7 @@ // Needs the height constraint heightConstraint.active = YES; - if (!spaceAbove && !spaceBelow) { + if (spaceAbove == nil && spaceBelow == nil) { // No set space above or below, make the spacers the same height with a default minimum. UIView *topSpacer = [MVMCoreUICommonViewsUtility commonView]; @@ -237,7 +238,7 @@ minimumHeightSpacer.active = YES; [NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[topBetweenEdgeView]-0-[topSpacer]-0-[viewBetween]-0-[bottomSpacer]-0-[bottomBetweenEdgeView]" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topBetweenEdgeView,topSpacer,viewBetween,bottomSpacer,bottomBetweenEdgeView)]]; - } else if (spaceAbove) { + } else if (spaceAbove != nil) { // Space above is set, space below is free. UIView *bottomSpacer = [MVMCoreUICommonViewsUtility commonView]; @@ -249,7 +250,7 @@ NSDictionary *verticalMetrics = @{@"top":spaceAbove}; [NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[topBetweenEdgeView]-top-[viewBetween]-0-[bottomSpacer]-0-[bottomBetweenEdgeView]" options:NSLayoutFormatDirectionLeadingToTrailing metrics:verticalMetrics views:NSDictionaryOfVariableBindings(topBetweenEdgeView,viewBetween,bottomSpacer,bottomBetweenEdgeView)]]; - } else if (spaceBelow) { + } else if (spaceBelow != nil) { // Space below is set, space above is free. UIView *topSpacer = [MVMCoreUICommonViewsUtility commonView]; diff --git a/MVMCoreUI/Legacy/Views/MFCaretButton.m b/MVMCoreUI/Legacy/Views/MFCaretButton.m index bd8f058c..e5deff1c 100644 --- a/MVMCoreUI/Legacy/Views/MFCaretButton.m +++ b/MVMCoreUI/Legacy/Views/MFCaretButton.m @@ -49,7 +49,7 @@ CGFloat const CaretViewWidth = 6.6f; - (void)addCaretImageView { [self.rightView removeFromSuperview]; UIEdgeInsets edgeInsets = self.contentEdgeInsets; - CGFloat rightInset = self.rightViewWidth?self.rightViewWidth.floatValue:CaretViewWidth; + CGFloat rightInset = self.rightViewWidth != nil ? self.rightViewWidth.floatValue : CaretViewWidth; UIEdgeInsets newInsets = UIEdgeInsetsMake(edgeInsets.top, edgeInsets.left, edgeInsets.bottom, 4 + rightInset); self.contentEdgeInsets = newInsets; UIView *caretViewIs = self.rightView; @@ -60,11 +60,11 @@ CGFloat const CaretViewWidth = 6.6f; self.rightView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:self.rightView]; - CGFloat width = self.rightViewWidth?self.rightViewWidth.floatValue:CaretViewWidth; + CGFloat width = self.rightViewWidth != nil ? self.rightViewWidth.floatValue : CaretViewWidth; NSLayoutConstraint *caretViewWidthConstraint = [NSLayoutConstraint constraintWithItem:caretViewIs attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:width]; caretViewWidthConstraint.active = YES; - CGFloat height = self.rightViewHeight?self.rightViewHeight.floatValue:CaretViewHeight; + CGFloat height = self.rightViewHeight != nil ? self.rightViewHeight.floatValue : CaretViewHeight; NSLayoutConstraint *caretViewHeightConstraint = [NSLayoutConstraint constraintWithItem:caretViewIs attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:height]; caretViewHeightConstraint.active = YES; diff --git a/MVMCoreUI/Legacy/Views/MFCaretView.m b/MVMCoreUI/Legacy/Views/MFCaretView.m index 182f7a74..c8036f57 100644 --- a/MVMCoreUI/Legacy/Views/MFCaretView.m +++ b/MVMCoreUI/Legacy/Views/MFCaretView.m @@ -65,7 +65,7 @@ CGContextClearRect(context, rect); CGFloat lineWidth; - if (self.lineWidth) { + if (self.lineWidth != nil) { lineWidth = self.lineWidth.floatValue; } else { lineWidth = self.frame.size.width/2.6; diff --git a/MVMCoreUI/Legacy/Views/MFRadioButton.h b/MVMCoreUI/Legacy/Views/MFRadioButton.h index c5e053c0..740a6192 100644 --- a/MVMCoreUI/Legacy/Views/MFRadioButton.h +++ b/MVMCoreUI/Legacy/Views/MFRadioButton.h @@ -43,10 +43,10 @@ typedef void (^CircleSelectedClosure)(_Nonnull id sender); @property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint; @property (nonatomic) BOOL respondsToTapGesture; @property (nonatomic, getter = isSelected) BOOL selected; -@property (strong, nonatomic) NSLayoutConstraint *innerHeightConstarint; -@property (strong, nonatomic) NSLayoutConstraint *innerWidthConstarint; -@property (strong, nonatomic) NSLayoutConstraint *outerHeightConstarint; -@property (strong, nonatomic) NSLayoutConstraint *outerWidthConstarint; +@property (strong, nonatomic, nullable) NSLayoutConstraint *innerHeightConstarint; +@property (strong, nonatomic, nullable) NSLayoutConstraint *innerWidthConstarint; +@property (strong, nonatomic, nullable) NSLayoutConstraint *outerHeightConstarint; +@property (strong, nonatomic, nullable) NSLayoutConstraint *outerWidthConstarint; // Set line width manually - (void)setCheckMarkLineWidth:(CGFloat)lineWidth; diff --git a/MVMCoreUI/Legacy/Views/MFTextField.h b/MVMCoreUI/Legacy/Views/MFTextField.h index 323c59fd..260bc936 100644 --- a/MVMCoreUI/Legacy/Views/MFTextField.h +++ b/MVMCoreUI/Legacy/Views/MFTextField.h @@ -131,8 +131,4 @@ - (void)setAccessibilityString:(nullable NSString *)accessibilityString; -// For Validator Protocol -- (nullable NSString *)formFieldName; -- (nullable id)formFieldValue; - @end diff --git a/MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m b/MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m index 4a7125fe..0799c224 100644 --- a/MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m +++ b/MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m @@ -61,21 +61,21 @@ const CGFloat SwitchShakeIntensity = 2; } - (instancetype)initWithCoder:(NSCoder *)coder { - if ([super initWithCoder:coder]) { + if (self = [super initWithCoder:coder]) { [self setupView]; } return self; } - (instancetype)initWithFrame:(CGRect)frame { - if ([super initWithFrame:frame]) { + if (self = [super initWithFrame:frame]) { [self setupView]; } return self; } - (instancetype)init { - if ([super init]) { + if (self = [super init]) { [self setupView]; } return self; diff --git a/MVMCoreUI/Legacy/Views/SeparatorView.h b/MVMCoreUI/Legacy/Views/SeparatorView.h index 40489b16..89a9197d 100644 --- a/MVMCoreUI/Legacy/Views/SeparatorView.h +++ b/MVMCoreUI/Legacy/Views/SeparatorView.h @@ -41,7 +41,4 @@ typedef enum : NSUInteger { - (void)setAsLight; - (void)setAsMedium; -/// Returns if the separator should be visible based on the type. -- (BOOL)shouldBeVisible; - @end diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m index cc25cd9b..6fc7121f 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m @@ -79,7 +79,7 @@ } - (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id )animationDelegate viewToLayout:(nonnull UIView *)viewTolayout { - if ([self init]) { + if (self = [self init]) { self.animationDelegate = animationDelegate; self.viewToLayout = viewTolayout; @@ -119,7 +119,7 @@ } - (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message contentColor:(nonnull UIColor *)contentColor buttonTitle:(nullable NSString *)buttonTitle animationDelegate:(nullable id )animationDelegate viewToLayout:(nonnull UIView *)viewTolayout { - if ([self init]) { + if (self = [self init]) { self.animationDelegate = animationDelegate; self.viewToLayout = viewTolayout; [self setupViewWithTopMessage:topMessage message:message subMessage:nil contentColor:contentColor buttonTitle:buttonTitle]; @@ -128,7 +128,7 @@ } - (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage contentColor:(nonnull UIColor *)contentColor buttonTitle:(nullable NSString *)buttonTitle animationDelegate:(nullable id )animationDelegate viewToLayout:(nonnull UIView *)viewTolayout { - if ([self init]) { + if (self = [self init]) { self.animationDelegate = animationDelegate; self.viewToLayout = viewTolayout; [self setupViewWithTopMessage:topMessage message:message subMessage:subMessage contentColor:contentColor buttonTitle:buttonTitle]; @@ -137,7 +137,7 @@ } - (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage contentColor:(nonnull UIColor *)contentColor actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData animationDelegate:(nullable id )animationDelegate viewToLayout:(nonnull UIView *)viewTolayout { - if ([self init]) { + if (self = [self init]) { self.animationDelegate = animationDelegate; self.viewToLayout = viewTolayout; [self setupViewWithTopMessage:topMessage message:message subMessage:subMessage contentColor:contentColor actionMap:actionMap additionalData:additionalData]; diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m index 5b87d163..4ebfd013 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m @@ -59,7 +59,7 @@ } - (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id )animationDelegate { - if ([self init]) { + if (self = [self init]) { UIColor *contentColor = topAlertObject.textColor ?: [[MVMCoreUITopAlertView sharedGlobal] getContentColorForType:topAlertObject.type]; self.backgroundColor = topAlertObject.backgroundColor ?: [[MVMCoreUITopAlertView sharedGlobal] getBackgroundColorForType:topAlertObject.type]; [self setupViewWithLabelAndImage:topAlertObject.imageNameOrURL topImage:topAlertObject.aboveTextImageString]; @@ -72,7 +72,7 @@ - (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nullable UIColor *)contentColor message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData closeButton:(BOOL)closeButton animationDelegate:(nullable id )animationDelegate { // Handles all scenarios. - if ([self init]) { + if (self = [self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:nil topImage:nil]; [self setupCloseButton:closeButton animationDelegate:animationDelegate]; @@ -86,7 +86,7 @@ - (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nullable UIColor *)contentColor imageURL:(nullable NSString *)imageURL message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData closeButton:(BOOL)closeButton animationDelegate:(nullable id )animationDelegate { // Handles all scenarios. - if ([self init]) { + if (self = [self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:imageURL topImage:nil]; [self setupCloseButton:closeButton animationDelegate:animationDelegate]; @@ -98,7 +98,7 @@ - (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nullable UIColor *)contentColor imageURL:(nullable NSString *)imageURL message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage closeButton:(BOOL)closeButton animationDelegate:(nullable id )animationDelegate { // No main button. - if ([self init]) { + if (self = [self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:imageURL topImage:nil]; [self setupCloseButton:closeButton animationDelegate:animationDelegate]; @@ -286,7 +286,7 @@ - (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nonnull UIColor *)contentColor message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData { // No icon or close button. - if ([self init]) { + if (self = [self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:nil topImage:nil]; [self setupWithMessage:message subMessage:subMessage color:contentColor actionMap:actionMap additionalData:additionalData]; @@ -297,7 +297,7 @@ - (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nonnull UIColor *)contentColor message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage closeButton:(BOOL)closeButton animationDelegate:(nullable id )animationDelegate { // No main button. - if ([self init]) { + if (self = [self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:nil topImage:nil]; [self setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:nil userActionHandler:NULL]; @@ -309,7 +309,7 @@ - (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nonnull UIColor *)contentColor message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id _Nonnull sender))userActionHandler { // No icon or close button. Custom button action. - if ([self init]) { + if (self = [self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:nil topImage:nil]; [self setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:buttonTitle userActionHandler:userActionHandler]; diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m index 930828f6..5a94137a 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m @@ -86,7 +86,7 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed."; - (void)pinATopViewController:(UIViewController *)viewController { self.statusBarHeightConstraint.active = NO; - id topGuide = viewController.topLayoutGuide; + id topGuide = viewController.view.safeAreaLayoutGuide.topAnchor; self.statusBarBottomConstraint = [NSLayoutConstraint constraintWithItem:self.statusBarView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:topGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; self.statusBarBottomConstraint.active = YES; } diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.m b/MVMCoreUI/Utility/MVMCoreUIUtility.m index 4b0278de..bcead7fe 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.m @@ -150,7 +150,7 @@ } + (CGFloat)getHeightOfView:(nonnull UIView *)view forWidth:(nullable NSNumber *)width { - CGFloat floatWidth = (width ? width.floatValue : [MVMCoreUIUtility getWidth]); + CGFloat floatWidth = (width != nil ? width.floatValue : [MVMCoreUIUtility getWidth]); return [view systemLayoutSizeFittingSize:CGSizeMake(floatWidth, UILayoutFittingCompressedSize.height) withHorizontalFittingPriority:1000 verticalFittingPriority:250].height; } diff --git a/MVMCoreUI/Utility/Sizing/MFSizeObject.m b/MVMCoreUI/Utility/Sizing/MFSizeObject.m index 1acf878b..792e2d81 100644 --- a/MVMCoreUI/Utility/Sizing/MFSizeObject.m +++ b/MVMCoreUI/Utility/Sizing/MFSizeObject.m @@ -30,7 +30,7 @@ CGFloat const MFSizeiPadProLandscapeThreshold = 1300; + (CGFloat)getScaledValue:(CGFloat)value forSize:(CGFloat)size fromBase:(nullable NSNumber *)base { CGFloat baseFloat = 375.0; - if (base) { + if (base != nil) { baseFloat = [base floatValue]; } return value * (size/baseFloat);