This commit is contained in:
Suresh, Kamlesh 2019-11-15 12:09:20 -05:00
parent cd5f66875d
commit 89cbfe00ba
4 changed files with 6 additions and 35 deletions

View File

@ -71,6 +71,6 @@
- (BOOL)bottomViewOutsideOfScroll;
//override for setting attributed headline and message
-(void)setHeadlineAndMessage;
- (nullable NSArray *)topAccessoryViews;
- (nullable UIView *)topAccessoryView;
@end

View File

@ -71,19 +71,7 @@
}
}
- (nullable NSArray *)topAccessoryViews {
return nil;
}
- (nullable UIView *)setUpTopAccessoryView {
NSArray *accessoryViews = [self topAccessoryViews];
if (accessoryViews.count) {
UIView *topAccessoryView = [MVMCoreUICommonViewsUtility commonView];
[StackableViewController populateView:topAccessoryView withUIArray:accessoryViews withSpacingBlock:^UIEdgeInsets(id _Nullable object) {
return UIEdgeInsetsZero;
}];
return topAccessoryView;
}
- (nullable UIView *)topAccessoryView {
return nil;
}
@ -270,7 +258,7 @@
[header addSubview:topView];
[header addSubview:headerAccessoryView];
UIView *topAccessoryView = [self setUpTopAccessoryView];
UIView *topAccessoryView = [self topAccessoryView];
self.topAccessoryView = topAccessoryView;
if (topAccessoryView) {
[header addSubview:topAccessoryView];

View File

@ -38,7 +38,7 @@
#pragma mark - Subclass
- (nullable NSArray *)topAccessoryViews;
- (nullable UIView *)topAccessoryView;
// Allow you to add any additional ui before buildViewsBetweenLabelsAndButtons gets called. Can use this to set the topBetweenEdgeView or bottomBetweenEdgeView
- (void)buildInAdditionalViewsBeforeCenteredContent;

View File

@ -118,7 +118,7 @@
[self.contentView addSubview:topView];
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[topView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView)]];
UIView *topAccessoryView = [self setUpTopAccessoryView];
UIView *topAccessoryView = [self topAccessoryView];
self.topAccessoryView = topAccessoryView;
if (topAccessoryView) {
[self.contentView addSubview:topAccessoryView];
@ -280,24 +280,7 @@
}
}
- (nullable NSArray *)topAccessoryViews {
return nil;
}
- (nullable UIView *)setUpTopAccessoryView {
NSArray *accessoryViews = [self topAccessoryViews];
if (accessoryViews.count) {
UIView *topAccessoryView = [MVMCoreUICommonViewsUtility commonView];
__block typeof(self) weakSelf = self;
[StackableViewController populateView:topAccessoryView withUIArray:accessoryViews withSpacingBlock:^UIEdgeInsets(id _Nullable object) {
UIEdgeInsets edgeInsets = [weakSelf spaceAroundUIObject:object];
edgeInsets.left = 0;
edgeInsets.right = 0;
return edgeInsets;
}];
return topAccessoryView;
}
- (nullable UIView *)topAccessoryView {
return nil;
}