I'm trying to play a 4 seconds long .mp3 file in my swift application's launch screen. I know how to play the .mp3 file but the thing i don't know is where to put that code in order to play the file while user see launch screen. Which file i should use for this? I created a swift file and set it as the class of launch screen's .xib but it didn't work out.
Asked
Active
Viewed 1,031 times
1 Answers
2
Option 1 : You can load one ViewController at launching of app.
That VC have Splash image and will remain till you sound file is execute. Code of playing sound will contain in this VC only.
Option 2 : Code of play sound is AppDelegate's didFinishLaunchingWithOptions method. and make window visible after finish of your sound.
Second option, I had not practically tried.

Shreyank
- 1,549
- 13
- 24
-
Option 1 is the better one. – CZ54 May 20 '16 at 11:56
-
I like this. I did development using Option 1 – Cruz May 20 '16 at 14:31