Warning and analyze fixes
This commit is contained in:
parent
d1e02ad570
commit
7fdff34eeb
@ -100,7 +100,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
|
|
||||||
- (MFNumberOfDrawers)numberOfDrawersShouldShow:(NSNumber *)forWidth {
|
- (MFNumberOfDrawers)numberOfDrawersShouldShow:(NSNumber *)forWidth {
|
||||||
CGFloat width;
|
CGFloat width;
|
||||||
if (forWidth) {
|
if (forWidth != nil) {
|
||||||
width = [forWidth floatValue];
|
width = [forWidth floatValue];
|
||||||
} else {
|
} else {
|
||||||
width = [MVMCoreUISplitViewController getApplicationViewWidth];
|
width = [MVMCoreUISplitViewController getApplicationViewWidth];
|
||||||
@ -814,7 +814,6 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
// The main view.
|
// The main view.
|
||||||
NavigationController *navigationController = [NavigationController setupNavigationController];
|
NavigationController *navigationController = [NavigationController setupNavigationController];
|
||||||
self.navigationController = navigationController;
|
self.navigationController = navigationController;
|
||||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
|
||||||
|
|
||||||
UIView *mainView = navigationController.view;
|
UIView *mainView = navigationController.view;
|
||||||
mainView.translatesAutoresizingMaskIntoConstraints = NO;
|
mainView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
|||||||
@ -181,7 +181,7 @@
|
|||||||
__block NSInteger currentIndex = NSNotFound;
|
__block NSInteger currentIndex = NSNotFound;
|
||||||
if (!self.loadObject.pageDataFromCache) {
|
if (!self.loadObject.pageDataFromCache) {
|
||||||
NSNumber *currentIndexNumber = [self.loadObject.pageJSON optionalNumberForKey:@"currentTabIndex"];
|
NSNumber *currentIndexNumber = [self.loadObject.pageJSON optionalNumberForKey:@"currentTabIndex"];
|
||||||
if (currentIndexNumber) {
|
if (currentIndexNumber != nil) {
|
||||||
currentIndex = [currentIndexNumber integerValue];
|
currentIndex = [currentIndexNumber integerValue];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.
|
// 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;
|
- (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.
|
// Sets the screen to use the screen heading.
|
||||||
// it is required in device flow, where we are showing greeting name as 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
|
// device details screen heading needs to be updated/refreshed again, if user has changed device nick name
|
||||||
|
|||||||
@ -88,25 +88,10 @@
|
|||||||
self.pageType = loadObject.pageType;
|
self.pageType = loadObject.pageType;
|
||||||
self.loadObject = loadObject;
|
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.
|
// Verifies all modules needed are loaded.
|
||||||
return [MFViewController verifyRequiredModulesLoadedForLoadObject:loadObject error:error];
|
return [MFViewController verifyRequiredModulesLoadedForLoadObject:loadObject error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)parsePageJSON:(NSError * _Nullable * _Nullable)error {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sets the screen to use the screen heading.
|
// Sets the screen to use the screen heading.
|
||||||
// it is required in device flow, where we are showing greeting name as 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
|
// 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 {
|
- (BOOL)newPageLoaded:(nonnull NSDictionary *)page {
|
||||||
self.loadObject.pageJSON = page;
|
self.loadObject.pageJSON = page;
|
||||||
NSError *parseError = nil;
|
|
||||||
[self parsePageJSON:&parseError];
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,8 +35,8 @@
|
|||||||
@property (strong, nonatomic) UIView *topAccessoryView;
|
@property (strong, nonatomic) UIView *topAccessoryView;
|
||||||
|
|
||||||
// Adds the button view to the screen. Out of the scroll or in.
|
// Adds the button view to the screen. Out of the scroll or in.
|
||||||
- (void)addViewOutsideOfScrollView:(UIView *)bottomView;
|
- (void)addViewOutsideOfScrollView:(nonnull UIView *)bottomView;
|
||||||
- (void)addViewToContentView:(UIView *)bottomView;
|
- (void)addViewToContentView:(nonnull UIView *)bottomView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -133,8 +133,7 @@
|
|||||||
self.topConstraintForTopView.active = YES;
|
self.topConstraintForTopView.active = YES;
|
||||||
// Checks if we are using a different object than the bottom buttons.
|
// Checks if we are using a different object than the bottom buttons.
|
||||||
UIView *bottomView = [self useCustomViewInsteadOfButtons];
|
UIView *bottomView = [self useCustomViewInsteadOfButtons];
|
||||||
self.customBottemView = (bottomView != nil);
|
if (bottomView == nil) {
|
||||||
if (!self.customBottemView) {
|
|
||||||
|
|
||||||
// Sets up the buttons/button.
|
// Sets up the buttons/button.
|
||||||
NSDictionary *primaryButtonDictionary = [self primaryButtonMap];
|
NSDictionary *primaryButtonDictionary = [self primaryButtonMap];
|
||||||
@ -144,8 +143,10 @@
|
|||||||
self.primaryButton = buttonView.primaryButton;
|
self.primaryButton = buttonView.primaryButton;
|
||||||
bottomView = buttonView;
|
bottomView = buttonView;
|
||||||
self.bottomView = bottomView;
|
self.bottomView = bottomView;
|
||||||
|
self.customBottemView = NO;
|
||||||
} else {
|
} else {
|
||||||
self.bottomView = bottomView;
|
self.bottomView = bottomView;
|
||||||
|
self.customBottemView = YES;
|
||||||
}
|
}
|
||||||
[self updateTopLabelsBottomButtonsPadding];
|
[self updateTopLabelsBottomButtonsPadding];
|
||||||
|
|
||||||
@ -220,7 +221,7 @@
|
|||||||
// Needs the height constraint
|
// Needs the height constraint
|
||||||
heightConstraint.active = YES;
|
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.
|
// No set space above or below, make the spacers the same height with a default minimum.
|
||||||
UIView *topSpacer = [MVMCoreUICommonViewsUtility commonView];
|
UIView *topSpacer = [MVMCoreUICommonViewsUtility commonView];
|
||||||
@ -237,7 +238,7 @@
|
|||||||
minimumHeightSpacer.active = YES;
|
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)]];
|
[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.
|
// Space above is set, space below is free.
|
||||||
UIView *bottomSpacer = [MVMCoreUICommonViewsUtility commonView];
|
UIView *bottomSpacer = [MVMCoreUICommonViewsUtility commonView];
|
||||||
@ -249,7 +250,7 @@
|
|||||||
|
|
||||||
NSDictionary *verticalMetrics = @{@"top":spaceAbove};
|
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)]];
|
[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.
|
// Space below is set, space above is free.
|
||||||
UIView *topSpacer = [MVMCoreUICommonViewsUtility commonView];
|
UIView *topSpacer = [MVMCoreUICommonViewsUtility commonView];
|
||||||
|
|||||||
@ -49,7 +49,7 @@ CGFloat const CaretViewWidth = 6.6f;
|
|||||||
- (void)addCaretImageView {
|
- (void)addCaretImageView {
|
||||||
[self.rightView removeFromSuperview];
|
[self.rightView removeFromSuperview];
|
||||||
UIEdgeInsets edgeInsets = self.contentEdgeInsets;
|
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);
|
UIEdgeInsets newInsets = UIEdgeInsetsMake(edgeInsets.top, edgeInsets.left, edgeInsets.bottom, 4 + rightInset);
|
||||||
self.contentEdgeInsets = newInsets;
|
self.contentEdgeInsets = newInsets;
|
||||||
UIView *caretViewIs = self.rightView;
|
UIView *caretViewIs = self.rightView;
|
||||||
@ -60,11 +60,11 @@ CGFloat const CaretViewWidth = 6.6f;
|
|||||||
self.rightView.translatesAutoresizingMaskIntoConstraints = NO;
|
self.rightView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
[self addSubview:self.rightView];
|
[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];
|
NSLayoutConstraint *caretViewWidthConstraint = [NSLayoutConstraint constraintWithItem:caretViewIs attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:width];
|
||||||
caretViewWidthConstraint.active = YES;
|
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];
|
NSLayoutConstraint *caretViewHeightConstraint = [NSLayoutConstraint constraintWithItem:caretViewIs attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:height];
|
||||||
caretViewHeightConstraint.active = YES;
|
caretViewHeightConstraint.active = YES;
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
CGContextClearRect(context, rect);
|
CGContextClearRect(context, rect);
|
||||||
|
|
||||||
CGFloat lineWidth;
|
CGFloat lineWidth;
|
||||||
if (self.lineWidth) {
|
if (self.lineWidth != nil) {
|
||||||
lineWidth = self.lineWidth.floatValue;
|
lineWidth = self.lineWidth.floatValue;
|
||||||
} else {
|
} else {
|
||||||
lineWidth = self.frame.size.width/2.6;
|
lineWidth = self.frame.size.width/2.6;
|
||||||
|
|||||||
@ -43,10 +43,10 @@ typedef void (^CircleSelectedClosure)(_Nonnull id sender);
|
|||||||
@property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint;
|
@property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint;
|
||||||
@property (nonatomic) BOOL respondsToTapGesture;
|
@property (nonatomic) BOOL respondsToTapGesture;
|
||||||
@property (nonatomic, getter = isSelected) BOOL selected;
|
@property (nonatomic, getter = isSelected) BOOL selected;
|
||||||
@property (strong, nonatomic) NSLayoutConstraint *innerHeightConstarint;
|
@property (strong, nonatomic, nullable) NSLayoutConstraint *innerHeightConstarint;
|
||||||
@property (strong, nonatomic) NSLayoutConstraint *innerWidthConstarint;
|
@property (strong, nonatomic, nullable) NSLayoutConstraint *innerWidthConstarint;
|
||||||
@property (strong, nonatomic) NSLayoutConstraint *outerHeightConstarint;
|
@property (strong, nonatomic, nullable) NSLayoutConstraint *outerHeightConstarint;
|
||||||
@property (strong, nonatomic) NSLayoutConstraint *outerWidthConstarint;
|
@property (strong, nonatomic, nullable) NSLayoutConstraint *outerWidthConstarint;
|
||||||
|
|
||||||
// Set line width manually
|
// Set line width manually
|
||||||
- (void)setCheckMarkLineWidth:(CGFloat)lineWidth;
|
- (void)setCheckMarkLineWidth:(CGFloat)lineWidth;
|
||||||
|
|||||||
@ -131,8 +131,4 @@
|
|||||||
|
|
||||||
- (void)setAccessibilityString:(nullable NSString *)accessibilityString;
|
- (void)setAccessibilityString:(nullable NSString *)accessibilityString;
|
||||||
|
|
||||||
// For Validator Protocol
|
|
||||||
- (nullable NSString *)formFieldName;
|
|
||||||
- (nullable id)formFieldValue;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -61,21 +61,21 @@ const CGFloat SwitchShakeIntensity = 2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithCoder:(NSCoder *)coder {
|
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||||
if ([super initWithCoder:coder]) {
|
if (self = [super initWithCoder:coder]) {
|
||||||
[self setupView];
|
[self setupView];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
if ([super initWithFrame:frame]) {
|
if (self = [super initWithFrame:frame]) {
|
||||||
[self setupView];
|
[self setupView];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)init {
|
- (instancetype)init {
|
||||||
if ([super init]) {
|
if (self = [super init]) {
|
||||||
[self setupView];
|
[self setupView];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@ -41,7 +41,4 @@ typedef enum : NSUInteger {
|
|||||||
- (void)setAsLight;
|
- (void)setAsLight;
|
||||||
- (void)setAsMedium;
|
- (void)setAsMedium;
|
||||||
|
|
||||||
/// Returns if the separator should be visible based on the type.
|
|
||||||
- (BOOL)shouldBeVisible;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.animationDelegate = animationDelegate;
|
self.animationDelegate = animationDelegate;
|
||||||
self.viewToLayout = viewTolayout;
|
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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
- (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message contentColor:(nonnull UIColor *)contentColor buttonTitle:(nullable NSString *)buttonTitle animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.animationDelegate = animationDelegate;
|
self.animationDelegate = animationDelegate;
|
||||||
self.viewToLayout = viewTolayout;
|
self.viewToLayout = viewTolayout;
|
||||||
[self setupViewWithTopMessage:topMessage message:message subMessage:nil contentColor:contentColor buttonTitle:buttonTitle];
|
[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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
- (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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.animationDelegate = animationDelegate;
|
self.animationDelegate = animationDelegate;
|
||||||
self.viewToLayout = viewTolayout;
|
self.viewToLayout = viewTolayout;
|
||||||
[self setupViewWithTopMessage:topMessage message:message subMessage:subMessage contentColor:contentColor buttonTitle:buttonTitle];
|
[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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
- (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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout {
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.animationDelegate = animationDelegate;
|
self.animationDelegate = animationDelegate;
|
||||||
self.viewToLayout = viewTolayout;
|
self.viewToLayout = viewTolayout;
|
||||||
[self setupViewWithTopMessage:topMessage message:message subMessage:subMessage contentColor:contentColor actionMap:actionMap additionalData:additionalData];
|
[self setupViewWithTopMessage:topMessage message:message subMessage:subMessage contentColor:contentColor actionMap:actionMap additionalData:additionalData];
|
||||||
|
|||||||
@ -59,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
UIColor *contentColor = topAlertObject.textColor ?: [[MVMCoreUITopAlertView sharedGlobal] getContentColorForType:topAlertObject.type];
|
UIColor *contentColor = topAlertObject.textColor ?: [[MVMCoreUITopAlertView sharedGlobal] getContentColorForType:topAlertObject.type];
|
||||||
self.backgroundColor = topAlertObject.backgroundColor ?: [[MVMCoreUITopAlertView sharedGlobal] getBackgroundColorForType:topAlertObject.type];
|
self.backgroundColor = topAlertObject.backgroundColor ?: [[MVMCoreUITopAlertView sharedGlobal] getBackgroundColorForType:topAlertObject.type];
|
||||||
[self setupViewWithLabelAndImage:topAlertObject.imageNameOrURL topImage:topAlertObject.aboveTextImageString];
|
[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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
- (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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
||||||
|
|
||||||
// Handles all scenarios.
|
// Handles all scenarios.
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.backgroundColor = color;
|
self.backgroundColor = color;
|
||||||
[self setupViewWithLabelAndImage:nil topImage:nil];
|
[self setupViewWithLabelAndImage:nil topImage:nil];
|
||||||
[self setupCloseButton:closeButton animationDelegate:animationDelegate];
|
[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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
- (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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
||||||
|
|
||||||
// Handles all scenarios.
|
// Handles all scenarios.
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.backgroundColor = color;
|
self.backgroundColor = color;
|
||||||
[self setupViewWithLabelAndImage:imageURL topImage:nil];
|
[self setupViewWithLabelAndImage:imageURL topImage:nil];
|
||||||
[self setupCloseButton:closeButton animationDelegate:animationDelegate];
|
[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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
- (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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
||||||
|
|
||||||
// No main button.
|
// No main button.
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.backgroundColor = color;
|
self.backgroundColor = color;
|
||||||
[self setupViewWithLabelAndImage:imageURL topImage:nil];
|
[self setupViewWithLabelAndImage:imageURL topImage:nil];
|
||||||
[self setupCloseButton:closeButton animationDelegate:animationDelegate];
|
[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 {
|
- (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.
|
// No icon or close button.
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.backgroundColor = color;
|
self.backgroundColor = color;
|
||||||
[self setupViewWithLabelAndImage:nil topImage:nil];
|
[self setupViewWithLabelAndImage:nil topImage:nil];
|
||||||
[self setupWithMessage:message subMessage:subMessage color:contentColor actionMap:actionMap additionalData:additionalData];
|
[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 <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
- (nullable instancetype)initWithColor:(nonnull UIColor *)color contentColor:(nonnull UIColor *)contentColor message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage closeButton:(BOOL)closeButton animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate {
|
||||||
|
|
||||||
// No main button.
|
// No main button.
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.backgroundColor = color;
|
self.backgroundColor = color;
|
||||||
[self setupViewWithLabelAndImage:nil topImage:nil];
|
[self setupViewWithLabelAndImage:nil topImage:nil];
|
||||||
[self setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:nil userActionHandler:NULL];
|
[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 {
|
- (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.
|
// No icon or close button. Custom button action.
|
||||||
if ([self init]) {
|
if (self = [self init]) {
|
||||||
self.backgroundColor = color;
|
self.backgroundColor = color;
|
||||||
[self setupViewWithLabelAndImage:nil topImage:nil];
|
[self setupViewWithLabelAndImage:nil topImage:nil];
|
||||||
[self setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:buttonTitle userActionHandler:userActionHandler];
|
[self setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:buttonTitle userActionHandler:userActionHandler];
|
||||||
|
|||||||
@ -86,7 +86,7 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed.";
|
|||||||
|
|
||||||
- (void)pinATopViewController:(UIViewController *)viewController {
|
- (void)pinATopViewController:(UIViewController *)viewController {
|
||||||
self.statusBarHeightConstraint.active = NO;
|
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 = [NSLayoutConstraint constraintWithItem:self.statusBarView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:topGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
|
||||||
self.statusBarBottomConstraint.active = YES;
|
self.statusBarBottomConstraint.active = YES;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,7 +150,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ (CGFloat)getHeightOfView:(nonnull UIView *)view forWidth:(nullable NSNumber *)width {
|
+ (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;
|
return [view systemLayoutSizeFittingSize:CGSizeMake(floatWidth, UILayoutFittingCompressedSize.height) withHorizontalFittingPriority:1000 verticalFittingPriority:250].height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ CGFloat const MFSizeiPadProLandscapeThreshold = 1300;
|
|||||||
|
|
||||||
+ (CGFloat)getScaledValue:(CGFloat)value forSize:(CGFloat)size fromBase:(nullable NSNumber *)base {
|
+ (CGFloat)getScaledValue:(CGFloat)value forSize:(CGFloat)size fromBase:(nullable NSNumber *)base {
|
||||||
CGFloat baseFloat = 375.0;
|
CGFloat baseFloat = 375.0;
|
||||||
if (base) {
|
if (base != nil) {
|
||||||
baseFloat = [base floatValue];
|
baseFloat = [base floatValue];
|
||||||
}
|
}
|
||||||
return value * (size/baseFloat);
|
return value * (size/baseFloat);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user