constraining for stack

This commit is contained in:
Pfeil, Scott Robert 2019-04-24 16:14:22 -04:00
parent 1573e57f2c
commit 8a349ae16f
5 changed files with 19 additions and 8 deletions

View File

@ -131,4 +131,8 @@ open class CaretButton: MFCustomButton, MVMCoreUIMoleculeViewProtocol {
disabledColor = UIColor.mfGet(forHex: disabledColorHex)
}
}
public func needsToBeConstrained() -> Bool {
return true
}
}

View File

@ -141,4 +141,8 @@
}
}
- (BOOL)needsToBeConstrained {
return YES;
}
@end

View File

@ -91,7 +91,6 @@ open class CaretView: MFView {
// Default values for view.
@objc open override func setAsMolecule() {
defaultState()
}
@ -120,4 +119,8 @@ open class CaretView: MFView {
lineWidth = lineWidthValue
}
}
open override func needsToBeConstrained() -> Bool {
return true
}
}

View File

@ -268,7 +268,6 @@ import MVMCore
}
})
attributedText = attributedString
} else if !MVMCoreGetterUtility.fequal(a: Float(standardFontSize), b: 0.0), let sizeObject: MFSizeObject = self.sizeObject ?? MFStyler.sizeObjectGeneric(forCurrentDevice: standardFontSize) {
self.font = self.font.withSize(sizeObject.getValueBased(onSize: size))
}
@ -298,7 +297,6 @@ import MVMCore
@objc public func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: DelegateObject?, additionalData: [AnyHashable: Any]?) {
Label.setUILabel(self, withJSON: json, delegate: delegateObject, additionalData: additionalData)
originalAttributedString = attributedText
}

View File

@ -13,13 +13,16 @@
@interface ViewConstrainingView ()
@property (weak, nullable, nonatomic) UIView *constrainedView;
@property (strong, nullable, nonatomic) UIView <MVMCoreUIMoleculeViewProtocol>*molecule;
@property (weak, nullable, nonatomic) UIView <MVMCoreUIMoleculeViewProtocol>*molecule;
@end
@implementation ViewConstrainingView
- (nullable instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule {
if (self = [super init]) {
if (!molecule.superview) {
[self addConstrainedView:molecule];
}
self.molecule = molecule;
}
return self;
@ -129,9 +132,6 @@
[super setupView];
self.translatesAutoresizingMaskIntoConstraints = NO;
self.backgroundColor = [UIColor clearColor];
if (!self.molecule.superview) {
[self addConstrainedView:self.molecule];
}
}
- (void)updateView:(CGFloat)size {
@ -153,7 +153,9 @@
- (void)setAsMolecule {
self.updateViewHorizontalDefaults = YES;
[self.molecule setAsMolecule];
if ([self.molecule respondsToSelector:@selector(setAsMolecule)]) {
[self.molecule setAsMolecule];
}
}
- (void)setWithJSON:(NSDictionary *)json delegateObject:(DelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {