Where we created a Protocol based of AVPlayer functions
public protocol AVPlayerDefinedProtocol: AnyObject {
func addPeriodicTimeObserver(
forInterval interval: CMTime,
queue: DispatchQueue?,
using block: @escaping (CMTime) -> Void
) -> Any
// Other AvPlayer functions defined here.
...
..
}
++
import AVFoundation
extension AVPlayer: AVPlayerDefinedProtocol { } //throws error here.
// saying AVPlayer do not conform to AVPlayerDefinedProtocol . @Sendable or @mainActor needed.
I do not face this in Xcode 15.2 , Swift 5.0 . Is there any easy way to get past this.
Exactly, one weird thing I noticed in Xcode 16.2, clean build shows that error(even warnings as error is set to no). If I build it again(without clean build), it passes and I can even load the simulator with the build.