Were you able to use a class in earlier Xcode versions?
I am almost 100 percent sure you have to make PlayerView a struct. SwiftUI views are structs. The UIViewRepresentable protocol lets you wrap UIKit views to use them in SwiftUI apps, essentially converting UIKit views to SwiftUI views. Therefore views that use UIViewRepresentable must be structs.
Create a new class that has the @Published property and the Combine publishers. Add an instance of the class to PlayerView. That way you can use the @Published property and have the view be a struct.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: