I need some help with my app I have recently started. I am a very big starter to coding so please do help me, it’ll mean a lot. I need a piece of music to play as soon as the user enters my app, i have followed other youtube tutorials but they only work for the older Xcode versions, so please help thank you so much.
Share
How about putting it in you
application didFinishLaunchingbut be sure to instantiate it in you .h and .m.Something like this should do your problem:
Then if you want to stop it:
or pause it :
and also import it in your header file:
EDIT:
You should to ofcourse declare it in your header, then synthesize it.
//.h and add the bold part:
@interface ViewController : UIViewController <AVAudioPlayerDelegate> {
//.m