Observing Multiple NSKeyObservingKeyValueoptions swift -


how observe multiple nskeyobservingkeyvalueoptions in swift

 self.avplayeritem.addobserver(self, forkeypath: "status", options:[.initial | .new], context: nil) 

i error

error

no '|' candidates produce expected contextual result type 'nskeyvalueobservingoptions'

change

 self.avplayeritem.addobserver(self, forkeypath: "status", options:[.initial | .new], context: nil) 

to:

 self.avplayeritem.addobserver(self, forkeypath: "status", options:[.initial, .new], context: nil) 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -