Commit 9e666dce by Daniel Dahan

development: updated NavigationItem to allow contentViewAlignment to be set dynamically

parent 5462110c
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.3.16'
s.version = '2.3.17'
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.16</string>
<string>2.3.17</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -32,7 +32,7 @@ import UIKit
@objc(ContentViewAlignment)
public enum ContentViewAlignment: Int {
case any
case full
case center
}
......@@ -47,7 +47,7 @@ open class Bar: View {
}
/// Should center the contentView.
open var contentViewAlignment = ContentViewAlignment.any {
open var contentViewAlignment = ContentViewAlignment.full {
didSet {
layoutSubviews()
}
......
......@@ -93,7 +93,7 @@ public class NavigationItem: NSObject {
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
return
}
contentViewAlignment = .center == titleLabel.textAlignment ? .center : .any
contentViewAlignment = .center == titleLabel.textAlignment ? .center : .full
}
deinit {
......@@ -145,7 +145,12 @@ extension UINavigationItem {
/// Should center the contentView.
public var contentViewAlignment: ContentViewAlignment {
return navigationItem.contentViewAlignment
get {
return navigationItem.contentViewAlignment
}
set(value) {
navigationItem.contentViewAlignment = value
}
}
/// Content View.
......
......@@ -88,7 +88,7 @@ open class Toolbar: Bar {
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
return
}
contentViewAlignment = .center == titleLabel.textAlignment ? .center : .any
contentViewAlignment = .center == titleLabel.textAlignment ? .center : .full
}
/// Reloads the view.
......
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