analogcode / Swift-Radio-Pro

Professional Radio Station App for iOS!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two ViewControllers NowPlaying info not updating...

dardania84 opened this issue · comments

commented

When you are in StationViewController1 everything plays fine NowPlaying info updates ok, but when enter StationViewController2 NowPlaying updates ok on StationViewController2, when going back to StationViewController1 NowPlaying does NOT update station info playing.

How can i update NowPlaying info for StationViewController1 even if am playing stations from StationViewController2.

Can anyone help?

Thank you...

Hi @dardania84

The RadioPlayer class uses delegates to communicate with the StationViewController and it's one to one relationship, so when you add StationViewController2 it becomes the delegate and StationViewController1 won't be updated, if you'd like to listen to changes in more than one controller, you either have to create a mechanism (a middle class) to handle the delegate and update both controllers, or use notifications instead of delegates in the RadioPlayer class.