Skip to content

Commit

Permalink
a fix for the issue with auto layout feedback loops on ios 14 that su…
Browse files Browse the repository at this point in the history
…pports pannel mode. via issue #390
  • Loading branch information
ulmentflam committed Aug 20, 2020
1 parent 893b33d commit 6a426eb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions PulleyLib/PulleyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,20 @@ open class PulleyViewController: UIViewController, PulleyDrawerViewControllerDel
/// The currently rendered display mode for Pulley. This will match displayMode unless you have it set to 'automatic'. This will provide the 'actual' display mode (never automatic).
public fileprivate(set) var currentDisplayMode: PulleyDisplayMode = .automatic {
didSet {
if self.isViewLoaded
{
self.view.setNeedsLayout()

if oldValue == currentDisplayMode {
if self.isViewLoaded {
self.view.layoutIfNeeded()
}
}

if oldValue != currentDisplayMode
{
if self.isViewLoaded
{
self.view.setNeedsLayout()
}

delegate?.drawerDisplayModeDidChange?(drawer: self)
(drawerContentViewController as? PulleyDrawerViewControllerDelegate)?.drawerDisplayModeDidChange?(drawer: self)
(primaryContentContainer as? PulleyPrimaryContentControllerDelegate)?.drawerDisplayModeDidChange?(drawer: self)
Expand Down

0 comments on commit 6a426eb

Please sign in to comment.