I have something like a SlideUp View with a TableView inside. I am changing the constraint of my SlideUp View to increase the width. However, this is the result on sliding it up or down:
The result on slide down:
The result on slide up:
When the transition is finished, everything is normal:
This is the Code for my shadowed ViewContainer inside the TableView:
import UIKit
@IBDesignable class ShadowedView: UIView {
@IBInspectable var shadowed: Bool = true {
didSet {
setNeedsLayout()
}
}
@IBInspectable var cornerRadius: CGFloat = 0.0 {
didSet {
setNeedsLayout()
}
}
@IBInspectable var shadowRadius: CGFloat = 0.0 {
didSet {
setNeedsLayout()
}
}
override func layoutSubviews () {
super.layoutSubviews()
layer.shadowColor = UIColor.black.cgColor
layer.shadowOpacity = 1
layer.shadowRadius = shadowRadius
layer.shadowOffset = CGSize(width: 0, height: 0)
layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: cornerRadius).cgPath
layer.shouldRasterize = true
layer.rasterizationScale = UIScreen.main.scale
}
}
Where is this behavior coming from and how can I prevent it?


