Post

Replies

Boosts

Views

Activity

overrideUserInterfaceStyle in tvOS not working?
Regardless of how I set UIUserInterfaceStyle in info.plist, setting overrideUserInterfaceStyle on a UIViewController seems to do absolutely nothing (though the setting in info.plist doe override the system setting). Is overrideUserInterfaceStyle no longer supported? I'd like to provide a way for my users to override their system-wide dark or light mode in my app.
1
0
961
May ’21
Setting a view's CALayer.contents to CVPixelBuffer directly
I'm working on an app in which I create a CVPixelBuffer that I need to display as efficiently as possible. The fastest thing that seems work on a couple recent iPhones I've tested is to simply set the ViewController's layer.contents to the CVPixelBuffer. I was actually surprised this works as googling it would indicate that you can't just do this. However... upon testing this same piece of code on an old iPad Air 2, it didn't display anything. I did succeed in making it work on the iPad Air 2 by creating a CIImage from the CVPixelBuffer and then turning that into a CGImage and setting that to the layer's contents. I'm reluctant to use this in the application as it's considerably less efficient on the iPhone (I'm assuming that this entails some unnecessary extra uploads/downloads to the GPU). I'm trying to figure out which bit of code works on which hardware so I can fall back to the more CPU-intensive function for older hardware, but I'm not sure how to determine which hardware supports setting that CALayer contents to a CVPixelBuffer and which does not. Is there any documentation that would shed light on this? Thanks! Michael
4
0
3.1k
Feb ’21