Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow issue in Swift 4 iOS 11 simulator #74

Open
ankitbansal806 opened this issue Jul 26, 2017 · 1 comment
Open

Shadow issue in Swift 4 iOS 11 simulator #74

ankitbansal806 opened this issue Jul 26, 2017 · 1 comment

Comments

@ankitbansal806
Copy link

Shadow issue in Swift 4 iOS 11 simulator. Please give me the solution to remove this issue.
screen shot 2017-07-26 at 4 03 46 pm

@Mehul18292
Copy link

Mehul18292 commented Jul 17, 2019

@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)
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants