Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1.1 and 4.1.2 Blurview is clipped at the bottom of iPhone running iOS 13.6 #181

Closed
gesabo opened this issue Aug 4, 2020 · 5 comments
Closed
Labels

Comments

@gesabo
Copy link

gesabo commented Aug 4, 2020

I noticed that when using a blurred background the bottom of the iPhone screen below the BulletinBoard that had previously been blurred is now "exposed" showing whatever is underneath the BulletinBoard. I'm not sure why but I rolled back to 4.1.0 and it's displaying correctly, some change between 4.1.0 and 4.1.1 relating to the blurred background must be the cause?

iPhone 11 running iOS 13.6
BB version 4.1.1 and 4.1.2

@kenzinn
Copy link
Contributor

kenzinn commented Aug 7, 2020

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.

@Piidro
Copy link
Contributor

Piidro commented Aug 8, 2020

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.

@kenzinn
Copy link
Contributor

kenzinn commented Aug 14, 2020

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.

@alexisakers
Copy link
Owner

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

@kenzinn
Copy link
Contributor

kenzinn commented Nov 13, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants