Glenn Posadas
Glenn Posadas

Reputation: 13283

How to always show a viewcontroller even when navigating screens in iOS?

I have this music player view controller that can be minimized. Thanks to LNPopupController[https://github.com/LeoNatan/LNPopupController].

Everything is working fine, but I have no idea how to make this music player view controller stays on top even when the user navigates to the other screens (even when the main navigation controller pushes another view controller). The app doesn't use tab bar controller by the way.

enter image description here

So, is there a way to implement this kind of idea? Again, sticking the minimized view controller on top of every screens of the app?

Upvotes: 0

Views: 713

Answers (2)

wg_hjl
wg_hjl

Reputation: 545

enter image description hereadd the minimized view controller on keyWindown which your minimized view controller always on top ,I didnot Know whether can help you,the code demo gif as is show,If anyone need Demo,give me Email:59620one463qq.com(replace one to 1) to get demo

Upvotes: 0

Léo Natan
Léo Natan

Reputation: 57040

Developer of the framework here.

If you present the popup bar from a navigation controller, it will appear for all pushed controllers. Likewise for a tab bar controller.

If you need to have it for all controllers, it's not easily possible. One way is the have your entire application scene appear as a child controller of a view controller, and have that controller present the popup bar. This is a difficult way to make it work, and not recommended. It has many issues.

The popup controller is not meant to appear on the screen all the time. It is meant to implement a similar functionality as Apple's.

Upvotes: 1

Related Questions