Post

Replies

Boosts

Views

Activity

ApplicationMusicPlayer.shared.state.objectWillChange publisher emits twice.
I'm developing an app which utilises playback from the Apple Music catalogue using MusicKit. Playback works fine however, whenever the playback state changes the ApplicationMusicPlayer.shared.state.objectWillChange publisher is fired twice. Moreover, with each emit the ApplicationMusicPlayer.shared.state is different. An example: Music is playing in my app. Music is paused. (Through any method of pausing) The objectWillChange publisher is called twice. In first call state is .playing In the second call state is .paused The same happens if playback is then resumed except the states switch. First, .paused and then .playing. I'm using Combine's .sink() method. I've checked for accidental duplicate subscriptions but there is only one. Is this the intended behaviour or is this an issue?
1
0
570
Jul ’22