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.04k stars 342 forks source link

`progressViewStyle` is reset #190

Closed MaxHasADHD closed 7 years ago

MaxHasADHD commented 7 years ago

Description

When accessing the popupBar property, if the current state is hidden then popupBar is reset, losing all of its properties such as progress view style. It then regenerates the popupBar but since the style is not set again, it is lost.

Steps to Reproduce

Not exactly sure. Your example looks the same as mine. I set up the properties then present the controller.

Device, OS and Xcode Versions

iPhone 7, iOS 11, Xcode 9

LeoNatan commented 7 years ago

Do you mean, if the status bar is hidden and you change the properties, upon presentation, they are reset? Is it only for progressViewStyle or for other properties as well?

MaxHasADHD commented 7 years ago

I believe it is all properties of the popupBar, because if its hidden and returns nil then you have to assign the custom settings again.

LeoNatan commented 7 years ago

This sounds strange. What version of the framework are you using?

MaxHasADHD commented 7 years ago

I should be using the latest version, I just re-downloaded the source code a few days ago. In LNPopupController.m In - (LNPopupBar *)popupBar, After I set the progress view style, returns nil because _popupControllerState is hidden. Then it gets presented and creates a new popup bar, but the progress view style I set is not back to default which is none above iOS 10. My code looks like yours when presenting the bar so I don't have a clue why its set to hidden again.

LeoNatan commented 7 years ago

Please provide a demo project where this reproduces.

MaxHasADHD commented 7 years ago

I looked back at the example and found my mistake. I set popupBar properties on the content view controller just as the popupItem properties.

LeoNatan commented 7 years ago

The item is on the content controller because it is related to the content. The popup bar is on the container controller, as it is related to the presentation.