Commit 5c2d849d by Daniel Dahan

development: added centerViews to NavigationItem

parent 3386efad
...@@ -68,6 +68,13 @@ public class NavigationItem: NSObject { ...@@ -68,6 +68,13 @@ public class NavigationItem: NSObject {
} }
} }
/// Center items.
public var centerViews = [UIView]() {
didSet {
navigationBar?.layoutSubviews()
}
}
public var navigationBar: NavigationBar? { public var navigationBar: NavigationBar? {
return contentView.superview?.superview as? NavigationBar return contentView.superview?.superview as? NavigationBar
} }
...@@ -194,4 +201,14 @@ extension UINavigationItem { ...@@ -194,4 +201,14 @@ extension UINavigationItem {
navigationItem.rightViews = value navigationItem.rightViews = value
} }
} }
/// Center UIViews.
open var centerViews: [UIView] {
get {
return navigationItem.contentView.grid.views
}
set(value) {
navigationItem.contentView.grid.views = value
}
}
} }
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