Commit 6f9098e6 by Daniel Dahan

issue-907: Fixed layout ordering issues

parent 8e91d135
## 2.12.3
* [issue-907](https://github.com/CosmicMind/Material/issues/907): Fixed Layout ordering issues.
## 2.12.2
* [issue-860](https://github.com/CosmicMind/Material/issues/860): Updated TabBar color states and added an independent line color state.
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.12.2'
s.version = '2.12.3'
s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.'
s.homepage = 'http://materialswift.com'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.12.2</string>
<string>2.12.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -631,14 +631,26 @@ public class Layout {
fileprivate extension Layout {
/**
Updates and lays out the constraints for a given view.
Updates the consraints for a given view.
- Parameter for view: A UIView.
*/
class func updateConstraints(for view: UIView) {
view.updateConstraintsIfNeeded()
view.updateConstraints()
view.setNeedsLayout()
view.layoutIfNeeded()
DispatchQueue.main.async {
view.setNeedsLayout()
view.layoutIfNeeded()
view.updateConstraintsIfNeeded()
view.updateConstraints()
}
}
/**
Updates the constraints for a given Array of views.
- Parameter for [view]: An Array of UIViews.
*/
class func updateConstraints(for views: [UIView]) {
for v in views {
updateConstraints(for: v)
}
}
}
......@@ -700,9 +712,7 @@ extension Layout {
parent.addConstraint(NSLayoutConstraint(item: children[children.count - 1], attribute: .right, relatedBy: .equal, toItem: parent, attribute: .right, multiplier: 1, constant: -right))
}
for child in children {
updateConstraints(for: child)
}
updateConstraints(for: children)
}
/**
......@@ -726,9 +736,7 @@ extension Layout {
parent.addConstraint(NSLayoutConstraint(item: children[children.count - 1], attribute: .bottom, relatedBy: .equal, toItem: parent, attribute: .bottom, multiplier: 1, constant: -bottom))
}
for child in children {
updateConstraints(for: child)
}
updateConstraints(for: children)
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment