hide separator flag
This commit is contained in:
parent
aeaf7ecc5e
commit
32b2ab825b
@ -41,4 +41,7 @@ typedef enum : NSUInteger {
|
||||
- (void)setAsLight;
|
||||
- (void)setAsMedium;
|
||||
|
||||
/// Returns if the separator should be visible based on the type.
|
||||
- (BOOL)shouldBeVisible;
|
||||
|
||||
@end
|
||||
|
||||
@ -162,6 +162,10 @@
|
||||
[self setNeedsLayout];
|
||||
[self layoutIfNeeded];
|
||||
}
|
||||
|
||||
- (BOOL)shouldBeVisible {
|
||||
return ![[self.json string:KeyType] isEqualToString:@"none"];
|
||||
}
|
||||
|
||||
#pragma mark - Molecule
|
||||
|
||||
|
||||
@ -31,10 +31,15 @@ import UIKit
|
||||
guard let molecules = json?.optionalArrayForKey(KeyMolecules) as? [[AnyHashable: Any]] else {
|
||||
return
|
||||
}
|
||||
|
||||
if accordionButton.isSelected {
|
||||
delegateObject?.moleculeDelegate?.addMolecules?(molecules, senderIndexPath: indexPath)
|
||||
} else {
|
||||
delegateObject?.moleculeDelegate?.removeMolecules?(molecules, senderIndexPath: indexPath)
|
||||
}
|
||||
|
||||
if (json?.boolForKey("hideSeparatorWhenExpanded") ?? false) && (self.bottomSeparatorView?.shouldBeVisible() ?? false) {
|
||||
bottomSeparatorView?.isHidden = accordionButton.isSelected
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user