LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.03k stars 340 forks source link

Popup drag animation causes controller to get stuck under status bar #374

Closed dancarasco closed 4 years ago

dancarasco commented 4 years ago

Popup is presented on a TabBarController which is parent of several child navigation controllers. The popup's content view controller is a regular UIViewController.

The UIViewController has prefersStatusBarHidden set to YES. Drag style is set to default (iOS 10.0+)

When clicking the arrow or popup bar to hide and show the VC, the status bar animation works as expected:

expected

When slowly dragging the VC downwards, the status bar does not update and gets stuck on top of the tab bar contents:

unexpected

Have tried messing around with setNeedsStatusBarAppearanceUpdate() but no luck. Setting prefersStatusBarHidden to NO eliminates this problem.

Simulated on iPhone 8 with iOS 12.4+. Works as expected on iPhone X and above. Using latest LNPopupController framework.

LeoNatan commented 4 years ago

Thanks Will look into it when I have time.

LeoNatan commented 4 years ago

Is it reproducible in the example project?

dancarasco commented 4 years ago

Thanks for the fast response @LeoNatan

Is it reproducible in the example project?

Yes - have set prefersStatusBarHidden to YES in the example project, and you can see the same behaviour occurs:

On click:

expected_example

The "Gallery" button re-appears in the correct place.

On drag:

unexpected_example

The "Gallery" button is further up than it should be.

LeoNatan commented 4 years ago

Thanks for checking. I will take a look.

LeoNatan commented 4 years ago

Will look into this tomorrow.

LeoNatan commented 4 years ago

Fixed in master, will release a new version soon.