I have a Cocoa Swift macOS application that I am developing. I would like to obtain an AVPlayerView with round corners and a shadow. If I enable the shadow in interface builder it shows correctly there but not when I run the app, and drawRect in my subclass is never called so I don't have a clue to where to draw round corners. Any help is much appreciated. Thanks
In a Cocoa Swift macOS application, is there a way to subclass AVPlayerView to get round corners and a shadow?
95 views Asked by Alfonso Tesauro At
2
You could put the AVPlayerView inside a container view, and apply the cornerRadius and maskToBounds on that view instead of trying to subclass AVPlayerView itself.