Coder Social home page Coder Social logo

Comments (5)

kenzinn avatar kenzinn commented on June 23, 2024 1

I've had a chance to run a few tests with this fix and it seems to have the desired effect: the showBulletin(above:animated:completion:) method does now place the blur over the specified viewController's view.

Thank you.

from bulletinboard.

kenzinn avatar kenzinn commented on June 23, 2024

Hi. I ran into this issue as well. It happens when using showBulletin(above:animated:completion:) and the presenting ViewController is smaller than the window. (For example, if it is being presented modally as a page sheet which, starting in iOS 13, uses card-like look rather than full-screen.)

Looks like it has to do with this fix ( #173 ) in 4.1.1. that fixed an issue with iPad presentations when using split-screen multitasking ( #172 ). The added line in BulletinPresentationAnimationController.swift is:

// Fix the frame (Needed for iPad app running in split view) if let fromFrame = transitionContext.viewController(forKey: .from)?.view.frame { toVC.view.frame = fromFrame }

The problem, best as I can tell, is that we're getting a frame that is in the coordinate system of the ViewController we are presenting "above" (which will always be located at (0,0)), and then applying that frame in the coordinate system of the transitionContext's containerView, which, it seems, is the size of the full window. So if the presentingVC is a modally presented page sheet and its height is less than the window, the blurred background will start at the top and not reach the bottom, leaving the "exposed" area at the bottom of the screen as you describe.

A couple of solutions:

  • The easiest is to switch from using the showBulletin(above:animated:completion:) method of BLTNItemManager to the showBulletin(in:animated:completion:) method, which, according to the docs: "Presents the bulletin on top of your application window." In my case, this was more or less what I really wanted, anyway.
  • I did experiment and found that by modifying the lines above in BulletinPresentationAnimationController.swift, I could bring about the desired behavior by using UIView's convert(_ rect: CGRect, to view: UIView?) -> CGRect to convert the "fromFrame" into the right coordinate system before applying it to the toVC.view. If there is sufficient interest I could work up a pull request with that modification. It worked well in my tests, but I don't know if there would be any unwanted side effects.

from bulletinboard.

Piidro avatar Piidro commented on June 23, 2024

Hey @gesabo & @kenzinn I am responsible for that PR which probably introduced this issue. I have witnessed this issue couple times myself also and my solution was also to just use the showBulletin(in:animated:completion) -version. I am not speaking on behalf of the people maintaining this library but I think that you could just fire away a PR if you think it will solve the issue. Then we will know.

from bulletinboard.

kenzinn avatar kenzinn commented on June 23, 2024

Hey @Piidro, thank you for the PR which fixed the iPad split screen issue.

I've created a PR (#183) to fix this one. If it's not found useful, no worries. Thank you all.

from bulletinboard.

alexisakers avatar alexisakers commented on June 23, 2024

This should be fixed in the upcoming release, could you please confirm it? #189

from bulletinboard.

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.