Commit 483f7225 by Daniel Dahan

development: fixed ordering with NavigationBar when backButton is present

parent 78163a30
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.3.12'
s.version = '2.3.13'
s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.'
s.homepage = 'http://materialswift.com'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.3.12</string>
<string>2.3.13</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -39,7 +39,7 @@ public enum GridAxisDirection: Int {
public struct GridAxis {
/// The direction the grid lays its views out.
var direction = GridAxisDirection.horizontal
public var direction = GridAxisDirection.horizontal
/// The rows size.
public var rows: Int
......@@ -77,12 +77,12 @@ public struct GridOffset {
}
public struct Grid {
/// Defer the calculation.
public var deferred = false
/// Context view.
internal weak var context: UIView?
/// Defer the calculation.
public var deferred = false
/// Number of rows.
public var rows: Int {
didSet {
......@@ -197,6 +197,13 @@ public struct Grid {
return
}
for v in views {
if canvas != v.superview {
v.removeFromSuperview()
canvas.addSubview(v)
}
}
guard 0 < canvas.width && 0 < canvas.height else {
return
}
......@@ -211,11 +218,6 @@ public struct Grid {
var i = 0
for v in views {
if canvas != v.superview {
v.removeFromSuperview()
canvas.addSubview(v)
}
// Forces the view to adjust accordingly to size changes, ie: UILabel.
(v as? UILabel)?.sizeToFit()
......
......@@ -141,7 +141,7 @@ extension NavigationController: UINavigationBarDelegate {
if let v = navigationBar as? NavigationBar {
item.backButton.addTarget(self, action: #selector(handleBackButton), for: .touchUpInside)
item.backButton.image = v.backButtonImage
item.leftViews.append(item.backButton)
item.leftViews.insert(item.backButton, at: 0)
v.layoutNavigationItem(item: item)
}
return true
......
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