I don't really get the ios `...Protocol` and `...P...
# kotlin-native
I don't really get the ios
Let's say I have some code that looks like this:
Copy code
val player = AVAudioPlayer(soundUrl, null)
                player.delegate = object : AVAudioPlayerDelegateProtocol{
                    override fun audioPlayerDidFinishPlaying(
                        player: AVAudioPlayer,
                        successfully: Boolean
                    ) {
It complains that it needs to override all these ios NSObjectProtocol methods which is probably not something that I want. But when I try to use
player.delegate complains that it doesn not conform to
Can I make the delegate work without implementing all these weird NSObjectProtocol methods.?
✔️ 1
Okay, one can simply do sth like this:
Copy code
player.delegate = object : NSObject(), AVAudioPlayerDelegateProtocol {