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
Refer to customBarViewController always gives nil
#383
Comments
|
So, as I want custom things and custom layouts, I made a custom bar but it's not accessible than it's of no use. These are some logs I got
|
And what about po self.tabBarController.popupBar |
@iDevelopper It's |
From which controller? |
I am calling |
In your playerViewController, which is the contentViewController, you simply access the popuItem like this: self.popupItem The popupBar is: self.popupPresentationContainer?.popupBar (you do not have a tabBarController here, this is the popupPresentationContainer's property) |
@iDevelopper Here is the log for
|
I think you are in the viewDidLoad function, try in viewWillAppear. |
@iDevelopper But why? If it's there in |
popupPresentationContainer is set during the popup bar presentation. You probably load your playerViewController before the presentation... |
Do you need to access to popupPresentationContainer in viewDidLoad? Why? |
I am loading it as it described in readme |
Yes, this is how you present the popup bar. But your vc (the player view controller) is already allocated and his view loaded. Then in viewDidLoad you can't have access to popupPresentationContainer. Search why his view is already loaded. Look at your instantiate() function... And put a breakpoint in viewDidLoad() function, you will see that the view is loaded before the popup bar presentation. |
@iDevelopper I don't understand this scenario. can you help me If I am sharing my screen? |
You can share your screen but your code is welcome to understand. I ask the question again: Do you need to access to popupPresentationContainer in viewDidLoad? |
@iDevelopper I want it on runtimes, like when song loads or song change
I have checked you have a git repo for |
Can you present the popup bar and set currentMedia in the completion block? A least for the first song... |
@iDevelopper ok. Let me try |
@iDevelopper Yes SIr, It worked. Now I understood that the thing is PlayerView Loads even before completing presentation of popupBar and that's why it's not even in hierarchy of controllers and that's why it produces |
@StackHelp , glad to hear it works!
This framework support custom bars. But a little outdated, I will update with a new version soon. If you want to test?... The main difference with LN is that this framework uses fewer private APIs and animates views (such as image or controls), as the Apple Music application does. |
@iDevelopper Yes, I will surely test it once you updated it. I like to do that. |
I am trying to use the custom controller as a
popupBar
and for that, I set up code likeNow, the problem is when I'm trying to refer
customBarViewController
, it gives menil
So, What's the correct way to refer
customBarViewController
that we can change/ update elements that are part of it.Device, OS and Xcode Versions
Simulator: iPhone 11, XCode Version 11.2.1, iOS 13
Device: iPhone 7, XCode Version 11.2.1, iOS 13
The text was updated successfully, but these errors were encountered: