noblakit01 / SwiftyShadow

Helper Shadow Path for UIView in Swift iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

view.layer.shadowOffset is hardcoded to CGSize.zero

allentomdude opened this issue · comments

Hello, UIView.generateOuterShadow() always sets the shadow directly underneath the view, and ignores the view's layer.shadowOffset.

Line 20 of UIView.swift generateOuterShadow() currently is:

    view.layer.shadowOffset = CGSize.zero

Should be updated to:

  view.layer.shadowOffset = layer.shadowOffset

In order to be able to position the outer shadow horizontally or vertically. I'll be happy to submit a pull request if you'd like.

@allentomdude Yes, please make a pull request and update shadowOffset in generateInnerShadow , generateEllipticalShadow too.

Thank you.

Fixed it, thank you man.