Commit 1643b97a by Daniel Dahan

issue-995: Updated iOS 11 layout margins for NavigationBar.

parent c67a2a93
## 2.14.0
* [issue-995](https://github.com/CosmicMind/Material/issues/995): Updated iOS 11 layout margins for NavigationBar.
* [pr-1038](https://github.com/CosmicMind/Material/pull/1038): Merged PR for iOS 11 layout margins fix.
## 2.13.7 ## 2.13.7
* Updated TabsController to no longer force the default animation to change between tabs and not return to normal behavior. * Updated TabsController to no longer force the default animation to change between tabs and not return to normal behavior.
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.13.7' s.version = '2.14.0'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.' s.summary = 'A UI/UX framework for creating beautiful applications.'
s.homepage = 'http://cosmicmind.com' s.homepage = 'http://cosmicmind.com'
......
Subproject commit 654928d706213db2cd9f71281361960177ad0c1d Subproject commit 100bf243fd065131bd6572f4ff06993b108a8e7e
...@@ -44,7 +44,7 @@ open class NavigationBar: UINavigationBar { ...@@ -44,7 +44,7 @@ open class NavigationBar: UINavigationBar {
} }
/// A preset wrapper around contentEdgeInsets. /// A preset wrapper around contentEdgeInsets.
open var contentEdgeInsetsPreset = EdgeInsetsPreset.none { open var contentEdgeInsetsPreset = EdgeInsetsPreset.square1 {
didSet { didSet {
contentEdgeInsets = EdgeInsetsPresetToValue(preset: contentEdgeInsetsPreset) contentEdgeInsets = EdgeInsetsPresetToValue(preset: contentEdgeInsetsPreset)
} }
...@@ -52,7 +52,7 @@ open class NavigationBar: UINavigationBar { ...@@ -52,7 +52,7 @@ open class NavigationBar: UINavigationBar {
/// A reference to EdgeInsets. /// A reference to EdgeInsets.
@IBInspectable @IBInspectable
open var contentEdgeInsets = EdgeInsets.zero { open var contentEdgeInsets = EdgeInsetsPresetToValue(preset: .square1) {
didSet { didSet {
layoutSubviews() layoutSubviews()
} }
...@@ -67,7 +67,7 @@ open class NavigationBar: UINavigationBar { ...@@ -67,7 +67,7 @@ open class NavigationBar: UINavigationBar {
/// A wrapper around grid.interimSpace. /// A wrapper around grid.interimSpace.
@IBInspectable @IBInspectable
open var interimSpace: InterimSpace = 0 { open var interimSpace = InterimSpacePresetToValue(preset: .interimSpace3) {
didSet { didSet {
layoutSubviews() layoutSubviews()
} }
...@@ -137,8 +137,8 @@ open class NavigationBar: UINavigationBar { ...@@ -137,8 +137,8 @@ open class NavigationBar: UINavigationBar {
//iOS 11 added left/right layout margin in subviews of UINavigationBar //iOS 11 added left/right layout margin in subviews of UINavigationBar
//since we do not want to unsafely access private view directly //since we do not want to unsafely access private view directly
//iterate subviews to set `layoutMargin` to zero //iterate subviews to set `layoutMargin` to zero
for view in subviews { for v in subviews {
view.layoutMargins = .zero v.layoutMargins = .zero
} }
if let v = topItem { if let v = topItem {
...@@ -148,6 +148,7 @@ open class NavigationBar: UINavigationBar { ...@@ -148,6 +148,7 @@ open class NavigationBar: UINavigationBar {
if let v = backItem { if let v = backItem {
layoutNavigationItem(item: v) layoutNavigationItem(item: v)
} }
layoutDivider() layoutDivider()
} }
...@@ -163,8 +164,6 @@ open class NavigationBar: UINavigationBar { ...@@ -163,8 +164,6 @@ open class NavigationBar: UINavigationBar {
isTranslucent = false isTranslucent = false
depthPreset = .none depthPreset = .none
contentScaleFactor = Screen.scale contentScaleFactor = Screen.scale
contentEdgeInsetsPreset = .none
interimSpacePreset = .none
backButtonImage = Icon.cm.arrowBack backButtonImage = Icon.cm.arrowBack
if #available(iOS 11, *) { if #available(iOS 11, *) {
......
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