alignment updates

This commit is contained in:
Pfeil, Scott Robert 2019-12-16 11:19:30 -05:00
parent 7926a8579c
commit f610264327
9 changed files with 25 additions and 27 deletions

View File

@ -136,7 +136,7 @@ open class CaretButton: MFCustomButton, MVMCoreUIMoleculeViewProtocol, MVMCoreUI
return true
}
open func alignment() -> UIStackView.Alignment {
open func horizontalAlignment() -> UIStackView.Alignment {
return UIStackView.Alignment.leading;
}

View File

@ -156,7 +156,7 @@
return YES;
}
- (UIStackViewAlignment)alignment {
- (UIStackViewAlignment)horizontalAlignment {
return UIStackViewAlignmentLeading;
}

View File

@ -131,7 +131,7 @@ extension CaretView: MVMCoreUIViewConstrainingProtocol {
return true
}
open func alignment() -> UIStackView.Alignment {
open func horizontalAlignment() -> UIStackView.Alignment {
return UIStackView.Alignment.leading;
}
}

View File

@ -165,7 +165,7 @@ extension CheckboxWithLabelView {
layoutIfNeeded()
}
override open func alignment() -> UIStackView.Alignment {
override open func horizontalAlignment() -> UIStackView.Alignment {
return .leading
}

View File

@ -598,7 +598,7 @@ extension Label {
return true
}
public func alignment() -> UIStackView.Alignment {
public func horizontalAlignment() -> UIStackView.Alignment {
return .leading
}

View File

@ -193,7 +193,7 @@ const CGFloat SwitchShakeIntensity = 2;
return YES;
}
- (UIStackViewAlignment)alignment {
- (UIStackViewAlignment)horizontalAlignment {
return UIStackViewAlignmentTrailing;
}

View File

@ -217,7 +217,7 @@ public extension Container {
}
if let verticalAlignmentString = json?.optionalStringForKey("verticalAlignment"), let alignment = ContainerHelper.getAlignment(for: verticalAlignmentString) ?? (view as? MVMCoreUIViewConstrainingProtocol)?.verticalAlignment?() {
containerHelper.alignHorizontal(alignment)
containerHelper.alignVertical(alignment)
} else if let alignment = (view as? MVMCoreUIViewConstrainingProtocol)?.verticalAlignment?() {
containerHelper.alignVertical(alignment)
}

View File

@ -54,7 +54,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
return YES;
}
- (UIStackViewAlignment)alignment {
- (UIStackViewAlignment)horizontalAlignment {
return UIStackViewAlignmentLeading;
}

View File

@ -135,26 +135,24 @@ open class MoleculeStackView: Container {
// Adds the molecules and sets the json.
for (index, map) in molecules.enumerated() {
if let moleculeJSON = map.optionalDictionaryForKey(KeyMolecule) {
var view: UIView?
var stackItemModel: StackItemModel
if let item = items?[index] {
stackItemModel = item
item.update(with: map)
view = item.view
(view as? MVMCoreUIMoleculeViewProtocol)?.setWithJSON(moleculeJSON, delegateObject: delegateObject, additionalData: nil)
addStackItem(item, lastItem: index == molecules.count - 1)
} else {
let stackItem = StackItem()
stackItem.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
view = stackItem
stackItemModel = StackItemModel(with: stackItem, json: map)
addStackItem(stackItemModel, lastItem: index == molecules.count - 1)
}
stackItemModel.useHorizontalMargins = moleculesShouldSetHorizontalMargins
stackItemModel.useVerticalMargins = moleculesShouldSetVerticalMargins
var view: UIView?
var stackItemModel: StackItemModel
if let item = items?[index] {
stackItemModel = item
item.update(with: map)
view = item.view
(view as? MVMCoreUIMoleculeViewProtocol)?.setWithJSON(map, delegateObject: delegateObject, additionalData: nil)
addStackItem(item, lastItem: index == molecules.count - 1)
} else {
let stackItem = StackItem()
stackItem.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
view = stackItem
stackItemModel = StackItemModel(with: stackItem, json: map)
addStackItem(stackItemModel, lastItem: index == molecules.count - 1)
}
stackItemModel.useHorizontalMargins = moleculesShouldSetHorizontalMargins
stackItemModel.useVerticalMargins = moleculesShouldSetVerticalMargins
}
}