diff --git a/CHANGELOG.md b/CHANGELOG.md
index 30b084b09..36cab9b38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 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.
diff --git a/Material.podspec b/Material.podspec
index 1933c2a87..a1a49ce46 100755
--- a/Material.podspec
+++ b/Material.podspec
@@ -1,6 +1,6 @@
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'
diff --git a/Sources/Info.plist b/Sources/Info.plist
index fe5d4f856..590fafc29 100644
--- a/Sources/Info.plist
+++ b/Sources/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 2.12.2
+ 2.12.3
CFBundleSignature
????
CFBundleVersion
diff --git a/Sources/iOS/Layout.swift b/Sources/iOS/Layout.swift
index 2a725df51..944feaa1b 100644
--- a/Sources/iOS/Layout.swift
+++ b/Sources/iOS/Layout.swift
@@ -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)
}
/**