Commit d361bbb3 by Daniel Dahan

fixed issue with pulse when in iOS 11 and landscape

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