fix: code review notes
This commit is contained in:
parent
2250b1b4d9
commit
40aa2876d1
|
|
@ -78,7 +78,7 @@ extension UIView {
|
|||
return .parentView(self)
|
||||
|
||||
} else {
|
||||
return .anyFinalView(self)
|
||||
return .leafView(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ open class SkeletonLayer: CAShapeLayer {
|
|||
case imageView(UIImageView)
|
||||
case textView(UITextView)
|
||||
case label(UILabel)
|
||||
case anyFinalView(UIView)
|
||||
case leafView(UIView)
|
||||
|
||||
public var view: UIView {
|
||||
switch self {
|
||||
|
|
@ -52,7 +52,7 @@ open class SkeletonLayer: CAShapeLayer {
|
|||
case let .textView(textView):
|
||||
return textView
|
||||
|
||||
case let .anyFinalView(view):
|
||||
case let .leafView(view):
|
||||
return view
|
||||
|
||||
case let .skeletonsHolderView(view):
|
||||
|
|
@ -121,8 +121,11 @@ open class SkeletonLayer: CAShapeLayer {
|
|||
open func remove(from view: UIView) {
|
||||
stopAnimation()
|
||||
removeFromSuperlayer()
|
||||
viewBoundsObservation = nil
|
||||
applicationStateObservation = nil
|
||||
viewBoundsObservation?.invalidate()
|
||||
|
||||
if let observation = applicationStateObservation {
|
||||
NotificationCenter.default.removeObserver(observation)
|
||||
}
|
||||
}
|
||||
|
||||
open func startAnimation() {
|
||||
|
|
@ -187,7 +190,7 @@ open class SkeletonLayer: CAShapeLayer {
|
|||
let viewFrame = CGRect(origin: rect.origin, size: path?.boundingBox.size ?? rect.size)
|
||||
frame = configuration.containerViewConfiguration.applyPadding(viewFrame: viewFrame)
|
||||
|
||||
case .anyFinalView(_):
|
||||
case .leafView(_):
|
||||
path = configuration.viewConfiguration.drawPath(rect: viewType.view.bounds)
|
||||
|
||||
let viewFrame = CGRect(origin: rect.origin, size: path?.boundingBox.size ?? rect.size)
|
||||
|
|
|
|||
Loading…
Reference in New Issue