Skip to content

Added ability to set drop shadow on/off #115

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions KYDrawerController/Classes/KYDrawerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ open class KYDrawerController: UIViewController, UIGestureRecognizerDelegate {

@IBInspectable public var drawerSegueIdentifier: String?

@IBInspectable public var dropShadow: Bool = true

private var _drawerConstraint: NSLayoutConstraint!

private var _drawerWidthConstraint: NSLayoutConstraint!
Expand Down Expand Up @@ -187,9 +189,11 @@ open class KYDrawerController: UIViewController, UIGestureRecognizerDelegate {
guard let drawerViewController = drawerViewController else { return }
addChildViewController(drawerViewController)

drawerViewController.view.layer.shadowColor = UIColor.black.cgColor
drawerViewController.view.layer.shadowOpacity = 0.4
drawerViewController.view.layer.shadowRadius = 5.0
if dropShadow {
drawerViewController.view.layer.shadowColor = UIColor.black.cgColor
drawerViewController.view.layer.shadowOpacity = 0.4
drawerViewController.view.layer.shadowRadius = 5.0
}
drawerViewController.view.translatesAutoresizingMaskIntoConstraints = false
_containerView.addSubview(drawerViewController.view)

Expand Down