Code Monkey home page Code Monkey logo

Comments (11)

Alex293 avatar Alex293 commented on May 12, 2024 2

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 :

screen shot 2017-01-24 at 15 10 51

While this is its position when I first load the view and after a dismiss if my modal is presented over full screen :

screen shot 2017-01-24 at 15 11 04

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.

amyleecodes avatar amyleecodes commented on May 12, 2024 1

@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.

ruilunli avatar ruilunli commented on May 12, 2024 1

@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)
screen shot 2017-08-03 at 7 50 52 pm
screen shot 2017-08-03 at 7 51 06 pm
screen shot 2017-08-03 at 7 52 22 pm

from pulley.

amyleecodes avatar amyleecodes commented on May 12, 2024 1

@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.

amyleecodes avatar amyleecodes commented on May 12, 2024

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.

Alex293 avatar Alex293 commented on May 12, 2024

Doesn't seems to do anything I'll try to investigate this more

from pulley.

amyleecodes avatar amyleecodes commented on May 12, 2024

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.

pschneider avatar pschneider commented on May 12, 2024

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.

ethansinjin avatar ethansinjin commented on May 12, 2024

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.

amyleecodes avatar amyleecodes commented on May 12, 2024

@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.

ruilunli avatar ruilunli commented on May 12, 2024

Thanks for spotting!

from pulley.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.