Comments (11)
Hi @Brendan09
I've tried lots of things but nothing seems to solve my issue. I didn't managed to reproduce the bug from the example, however I know what is the source of the issue : the passthrough view (in blue) of the pulley is out of the screen after dismissing view :
While this is its position when I first load the view and after a dismiss if my modal is presented over full screen :
The thing I don't understand is that this view is not accessible out of the lib so there is no way I've modified it.
from pulley.
@ethansinjin (some things to test, might help narrow it down) In your drawer content or main content VC, what happens if you do this in viewWIllAppear or viewDidAppear?
self.parent?.view.setNeedsLayout()
If that fixes the issue (even if it has a UI glitch), I have some ideas on what may be wrong.
If you can put together a sample with the issue (even if derived from the sample project in the repo), I'd much appreciate it. I can find you a solution then. I think another user was going to try to upload a sample project, but one never found its way to the issue.
Happy to take a look.
from pulley.
@Brendan09 Based on the sample project, I added a view controller before the pulley view controller. And in the drawer content view controller, instead of drawer.setPrimaryContentViewController
, I present as a modal. When the modal dismiss, the drawer view controller bugs. (The issue is found on iOS9)
from pulley.
@ruilunli Ok, I've found the issue.
The core of the issue is in these 2 lines in your sample:
self.definesPresentationContext = true
and
primaryContent.modalPresentationStyle = .currentContext
When you change the context to be a view controller inside of a nested view controller hierarchy, and do a regular (not 'over') presentation style you're creating an issue in how UIKit handles view controller presentation.
When you don't use an 'over' presentation style, the view of the previous view controller that was defining the presentation context is removed from it's superview (which is typically the window). Since you change that to the drawer view controller, the drawer view controller's view is removed from it's superview. When you dismiss the view controller that you presented, UIKit adds it back...but it adds it back in the wrong place. It puts it directly into the window, rather than back into it's nested view inside of Pulley.
This isn't a bug in Pulley, so much as a way that UIKit doesn't intend defining context for presentations to be used.
You can solve this by using the 'overCurrentContext' presentation style:
primaryContent.modalPresentationStyle = .overCurrentContext
I've also written a patch for Pulley that will prevent this from being an issue. It's a little hacky, but does resolve the problem. I'll push that to CocoaPods this afternoon.
Thanks so much for your help in tracking this down! (Also: Interesting way to prevent secondary 'drawer' views that I hadn't considered.)
from pulley.
Looks like it needs -definesPresentationContext set to true. I'll try to push that as a default in the next update. In the mean time, you can try setting the Pulley drawer's -definesPresentationContext property to true and see if that helps.
from pulley.
Doesn't seems to do anything I'll try to investigate this more
from pulley.
If anyone has a reliable way to replicate this, I'm happy to take a look. It works with modal presentations that I've tried (with definesPresentationContext set to true). A release coming out later today defaults definesPresentationContext to true.
from pulley.
I may have found a way to reproduce this in our project. Investigating.... will try to encapsulate this into a sample project sometime this week.
from pulley.
I know this issue hasn't been touched in a while, but I'm still seeing this problem. I can try to upload a video of the issue as well as a sample project describing the issue if that would help
from pulley.
@ruilunli I've tried doing what you described, but haven't been able to replicate it (even on iOS 9). Can you post a download link to the sample project in a broken state (or email it to me: [email protected]). Once I can replicate it, I can get a fix out for you. Thanks!
from pulley.
Thanks for spotting!
from pulley.
Related Issues (20)
- iOS 13 feedback loop with latest release 2.8.3 HOT 10
- Unable to drag the drawer on iOS 14 HOT 5
- Animation HOT 4
- [QUESTION] Help with error: "When instantiating from Interface Builder you must provide container views with an embedded view controller. HOT 1
- App getting hang on iOS 14 using pulley HOT 1
- Navigator BAr
- Remove possibly unnecessary view
- [BUG] iPad panel mode problem HOT 1
- [BUG] The latest version Pulley 2.9.0 does not start PulleyViewController HOT 1
- [QUESTION] How to resize the content of the drawer as it is opened and closed HOT 1
- [BUG] There is a 20 pixel top inset for the PulleyPassThroughScrollView which doesn't accept user action HOT 3
- Is there any way to apply corner radius to only one side? HOT 2
- Open other controller within Drawer
- [QUESTION] Update bounceOverflowMargin HOT 1
- Pulley drawer dimming view appears after UINavigationViewController push new viewController
- [QUESTION] How to control bounce of pulley when it is used in UITabBarController
- Strange lines on mac catalyst 16
- Trying to instantiateViewController to open the pulley view controller
- I hope there are more convenient functions, such as the function of directly displaying the QR code
- Privacy manifest adoption HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulley.