Skip to content

Commit

Permalink
Another fix to auto-layout feedback loops via #390
Browse files Browse the repository at this point in the history
  • Loading branch information
ulmentflam committed Sep 29, 2020
1 parent fdebcec commit 0392414
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<CommandLineArguments>
<CommandLineArgument
argument = "-UIViewLayoutFeedbackLoopDebuggingThreshold 100"
isEnabled = "NO">
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
Expand Down
32 changes: 21 additions & 11 deletions PulleyLib/PulleyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -371,33 +371,43 @@ open class PulleyViewController: UIViewController, PulleyDrawerViewControllerDel
/// The opacity of the drawer shadow.
@IBInspectable public var shadowOpacity: Float = 0.1 {
didSet {
if self.isViewLoaded
if oldValue != shadowOpacity
{
drawerShadowView.layer.shadowOpacity = shadowOpacity
self.view.setNeedsLayout()
if self.isViewLoaded
{
drawerShadowView.layer.shadowOpacity = shadowOpacity
self.view.setNeedsLayout()
}
}
}
}

/// The radius of the drawer shadow.
@IBInspectable public var shadowRadius: CGFloat = 3.0 {
didSet {
if self.isViewLoaded
if oldValue != shadowRadius
{
drawerShadowView.layer.shadowRadius = shadowRadius
self.view.setNeedsLayout()
if self.isViewLoaded
{
drawerShadowView.layer.shadowRadius = shadowRadius
self.view.setNeedsLayout()
}
}
}
}

/// The offset of the drawer shadow.
@IBInspectable public var shadowOffset = CGSize(width: 0.0, height: -3.0) {
didSet {
if self.isViewLoaded {
drawerShadowView.layer.shadowOffset = shadowOffset
self.view.setNeedsLayout()
}
}
if oldValue != shadowOffset
{
if self.isViewLoaded
{
drawerShadowView.layer.shadowOffset = shadowOffset
self.view.setNeedsLayout()
}
}
}
}

/// The opaque color of the background dimming view.
Expand Down

0 comments on commit 0392414

Please sign in to comment.