ios - The background music keep restarting. How to stop it. -
i create sharedinstance of background music , initialize in viewdidload of first view controller. when change screen (via segue) , come first screen, music restart. believe that's happen because viewdidload it's called again, don't want music keep restarting every time comeback screen.
how can manage music keep playing without interfering?
try starting background music in appdelegate , not having tied particular view controller.
although should typically avoid putting code in appdelegate, starting/initializing services start-up task, , makes sense there.
Comments
Post a Comment