ios - Music stops after interruption -
hello working on background music portion of app. have of music running until interruption comes along, either call or siri. using singleton play music comes https://github.com/raywenderlich/sktutils/blob/master/sktutils/sktaudio.swift (ray wenderlich). have attempted use avaudioplayer code automatically start playing again after interruption after code adapted singleton. seem run many problems on route. love know if there easy way things going again. music called when switch in on position if helps @ all. if guys need code ask please help!
in appdelegate in
func applicationdidbecomeactive(application: uiapplication)
i made if statement if switch true resumed background music.
var defaults = nsuserdefaults.standarduserdefaults() if defaults.boolforkey("switchstate") == true { sktaudio.sharedinstance().resumebackgroundmusic() }
Comments
Post a Comment