Commit d361bbb3 by Daniel Dahan

fixed issue with pulse when in iOS 11 and landscape

parent b165cae6
......@@ -259,12 +259,12 @@ extension CALayer {
return
}
if 0 == frame.width {
frame.size.width = frame.height
if 0 == bounds.width {
bounds.size.width = bounds.height
}
if 0 == frame.height {
frame.size.height = frame.width
if 0 == bounds.height {
bounds.size.height = bounds.width
}
guard .circle == shapePreset else {
......@@ -272,7 +272,7 @@ extension CALayer {
return
}
cornerRadius = frame.size.width / 2
cornerRadius = bounds.size.width / 2
}
/// Sets the shadow path.
......
......@@ -39,9 +39,6 @@ open class NavigationBar: UINavigationBar {
/// Detail UILabel when in landscape for iOS 11.
fileprivate var toolbarToText: [Toolbar: String?]?
/// PulseAnimation for different views.
fileprivate var viewToPulseAnimation: [UIView: PulseAnimation]?
open override var intrinsicContentSize: CGSize {
return CGSize(width: bounds.width, height: bounds.height)
}
......@@ -166,7 +163,6 @@ open class NavigationBar: UINavigationBar {
if #available(iOS 11, *) {
toolbarToText = [:]
viewToPulseAnimation = [:]
}
let image = UIImage()
......@@ -195,19 +191,6 @@ internal extension NavigationBar {
if Application.shouldStatusBarBeHidden {
toolbar.contentEdgeInsetsPreset = .none
for v in toolbar.leftViews + toolbar.rightViews {
guard var b = v as? Pulseable else {
continue
}
guard .none != b.pulseAnimation else {
continue
}
viewToPulseAnimation?[v] = b.pulseAnimation
b.pulseAnimation = .none
}
if nil != toolbar.detailLabel.text {
toolbarToText?[toolbar] = toolbar.detailLabel.text
toolbar.detailLabel.text = nil
......@@ -215,18 +198,6 @@ internal extension NavigationBar {
} else if nil != toolbarToText?[toolbar] {
toolbar.detailLabel.text = toolbarToText?[toolbar] ?? nil
toolbarToText?[toolbar] = nil
for v in toolbar.leftViews + toolbar.rightViews {
guard var b = v as? Pulseable else {
continue
}
guard let a = viewToPulseAnimation?[v] else {
continue
}
b.pulseAnimation = a
}
}
}
......
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