SSASideMenu
SSASideMenu copied to clipboard
Shadow issue in Swift 4 iOS 11 simulator
Shadow issue in Swift 4 iOS 11 simulator. Please give me the solution to remove this issue.

@ankitbansal806 , I got the same issue(for the new iphone X, XS, XS Max and XR). I have resolved this issue by updating method setupContentViewShadow() in the SSASideMenu's code.
the new code is as:
fileprivate func setupContentViewShadow() {
if contentViewShadowEnabled {
let safeAreaInsets = UIApplication.shared.keyWindow?.safeAreaInsets
var heightToUse = safeAreaInsets?.top ?? 20.0;
if heightToUse == 0{
heightToUse = 20.0;
}
let layer: CALayer = contentViewContainer.layer
let path: UIBezierPath = UIBezierPath(rect: CGRect(x: layer.bounds.x, y: layer.bounds.y+heightToUse, width: layer.bounds.width, height: layer.bounds.height-heightToUse))
layer.shadowPath = path.cgPath
layer.shadowColor = contentViewShadowColor.cgColor
layer.shadowOffset = contentViewShadowOffset
layer.shadowOpacity = contentViewShadowOpacity
layer.shadowRadius = CGFloat(contentViewShadowRadius)
}
}