AVPlayer displays error and not able to use avplayerdelegate

You must have to import the AVFoundation above the class like below.

import AVFoundation

class ViewController: UIViewController,AVAudioPlayerDelegate{




}


If you want to use the AVplayer inside the app you must import the avfoundation and then use the avaudioplayerdelegate.Then you can access the avplayer delegate methods.You can hear the song in your app with melody or beat as per your mood.

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift