alignment updates
This commit is contained in:
parent
7926a8579c
commit
f610264327
@ -136,7 +136,7 @@ open class CaretButton: MFCustomButton, MVMCoreUIMoleculeViewProtocol, MVMCoreUI
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
open func alignment() -> UIStackView.Alignment {
|
open func horizontalAlignment() -> UIStackView.Alignment {
|
||||||
return UIStackView.Alignment.leading;
|
return UIStackView.Alignment.leading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIStackViewAlignment)alignment {
|
- (UIStackViewAlignment)horizontalAlignment {
|
||||||
return UIStackViewAlignmentLeading;
|
return UIStackViewAlignmentLeading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -131,7 +131,7 @@ extension CaretView: MVMCoreUIViewConstrainingProtocol {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
open func alignment() -> UIStackView.Alignment {
|
open func horizontalAlignment() -> UIStackView.Alignment {
|
||||||
return UIStackView.Alignment.leading;
|
return UIStackView.Alignment.leading;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -165,7 +165,7 @@ extension CheckboxWithLabelView {
|
|||||||
layoutIfNeeded()
|
layoutIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
override open func alignment() -> UIStackView.Alignment {
|
override open func horizontalAlignment() -> UIStackView.Alignment {
|
||||||
return .leading
|
return .leading
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -598,7 +598,7 @@ extension Label {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
public func alignment() -> UIStackView.Alignment {
|
public func horizontalAlignment() -> UIStackView.Alignment {
|
||||||
return .leading
|
return .leading
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -193,7 +193,7 @@ const CGFloat SwitchShakeIntensity = 2;
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIStackViewAlignment)alignment {
|
- (UIStackViewAlignment)horizontalAlignment {
|
||||||
return UIStackViewAlignmentTrailing;
|
return UIStackViewAlignmentTrailing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -217,7 +217,7 @@ public extension Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let verticalAlignmentString = json?.optionalStringForKey("verticalAlignment"), let alignment = ContainerHelper.getAlignment(for: verticalAlignmentString) ?? (view as? MVMCoreUIViewConstrainingProtocol)?.verticalAlignment?() {
|
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?() {
|
} else if let alignment = (view as? MVMCoreUIViewConstrainingProtocol)?.verticalAlignment?() {
|
||||||
containerHelper.alignVertical(alignment)
|
containerHelper.alignVertical(alignment)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIStackViewAlignment)alignment {
|
- (UIStackViewAlignment)horizontalAlignment {
|
||||||
return UIStackViewAlignmentLeading;
|
return UIStackViewAlignmentLeading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -135,26 +135,24 @@ open class MoleculeStackView: Container {
|
|||||||
|
|
||||||
// Adds the molecules and sets the json.
|
// Adds the molecules and sets the json.
|
||||||
for (index, map) in molecules.enumerated() {
|
for (index, map) in molecules.enumerated() {
|
||||||
if let moleculeJSON = map.optionalDictionaryForKey(KeyMolecule) {
|
var view: UIView?
|
||||||
var view: UIView?
|
var stackItemModel: StackItemModel
|
||||||
var stackItemModel: StackItemModel
|
if let item = items?[index] {
|
||||||
if let item = items?[index] {
|
stackItemModel = item
|
||||||
stackItemModel = item
|
item.update(with: map)
|
||||||
item.update(with: map)
|
view = item.view
|
||||||
view = item.view
|
(view as? MVMCoreUIMoleculeViewProtocol)?.setWithJSON(map, delegateObject: delegateObject, additionalData: nil)
|
||||||
(view as? MVMCoreUIMoleculeViewProtocol)?.setWithJSON(moleculeJSON, delegateObject: delegateObject, additionalData: nil)
|
addStackItem(item, lastItem: index == molecules.count - 1)
|
||||||
addStackItem(item, lastItem: index == molecules.count - 1)
|
} else {
|
||||||
} else {
|
let stackItem = StackItem()
|
||||||
let stackItem = StackItem()
|
stackItem.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
stackItem.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
|
view = stackItem
|
||||||
view = stackItem
|
stackItemModel = StackItemModel(with: stackItem, json: map)
|
||||||
stackItemModel = StackItemModel(with: stackItem, json: map)
|
addStackItem(stackItemModel, lastItem: index == molecules.count - 1)
|
||||||
addStackItem(stackItemModel, lastItem: index == molecules.count - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
stackItemModel.useHorizontalMargins = moleculesShouldSetHorizontalMargins
|
|
||||||
stackItemModel.useVerticalMargins = moleculesShouldSetVerticalMargins
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stackItemModel.useHorizontalMargins = moleculesShouldSetHorizontalMargins
|
||||||
|
stackItemModel.useVerticalMargins = moleculesShouldSetVerticalMargins
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user