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

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -