hide separator flag
This commit is contained in:
parent
aeaf7ecc5e
commit
32b2ab825b
@ -41,4 +41,7 @@ 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
|
||||||
|
|||||||
@ -162,6 +162,10 @@
|
|||||||
[self setNeedsLayout];
|
[self setNeedsLayout];
|
||||||
[self layoutIfNeeded];
|
[self layoutIfNeeded];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)shouldBeVisible {
|
||||||
|
return ![[self.json string:KeyType] isEqualToString:@"none"];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Molecule
|
#pragma mark - Molecule
|
||||||
|
|
||||||
|
|||||||
@ -31,10 +31,15 @@ import UIKit
|
|||||||
guard let molecules = json?.optionalArrayForKey(KeyMolecules) as? [[AnyHashable: Any]] else {
|
guard let molecules = json?.optionalArrayForKey(KeyMolecules) as? [[AnyHashable: Any]] else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if accordionButton.isSelected {
|
if accordionButton.isSelected {
|
||||||
delegateObject?.moleculeDelegate?.addMolecules?(molecules, senderIndexPath: indexPath)
|
delegateObject?.moleculeDelegate?.addMolecules?(molecules, senderIndexPath: indexPath)
|
||||||
} else {
|
} else {
|
||||||
delegateObject?.moleculeDelegate?.removeMolecules?(molecules, senderIndexPath: indexPath)
|
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