I'm trying to create a music player application that plays audio files. I've managed to create the player but when I navigate back (or dismiss it), the view state is lost, though the control centre player is still playing the audio. Now when I make any attempts to go back to the player, the view loads all over again and two audios play simultaneously (from different starting points of course). I believe the problem is I'm not preserving the view when dismissing it. One way I thought was to keep track of all changes and load the view with the 'preserved' settings but since this is a music player, there are too many things to keep track of. So my question is:
The solution was to create and attach a subview that persists and then dismiss the subview from the superview whenever you're done using it.