From 5e0b1bb80f43c972684ff0df5367b7e0025daaca Mon Sep 17 00:00:00 2001 From: phlippieb Date: Mon, 16 Sep 2019 10:10:49 +0200 Subject: [PATCH] Fix Crash in Xcode 11 --- Sources/iOS/Navigation/NavigationBar.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/iOS/Navigation/NavigationBar.swift b/Sources/iOS/Navigation/NavigationBar.swift index ea796c5f8..04be72257 100644 --- a/Sources/iOS/Navigation/NavigationBar.swift +++ b/Sources/iOS/Navigation/NavigationBar.swift @@ -128,7 +128,15 @@ open class NavigationBar: UINavigationBar, Themeable { //since we do not want to unsafely access private view directly //iterate subviews to set `layoutMargin` to zero for v in subviews { - v.layoutMargins = .zero + if #available(iOS 13.0, *) { + let margins = v.layoutMargins + var frame = v.frame + frame.origin.x = -margins.left + frame.size.width += (margins.left + margins.right) + v.frame = frame + } else { + v.layoutMargins = .zero + } } if let v = topItem {