How do I check if a user has enabled Dark Appearance on their Apple TV?
相关问题
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
- Get the NSRange for the visible text after scroll
- UIPanGestureRecognizer is not working in iOS 13
- What does a Firebase observer actually do?
相关文章
- Using if let syntax in switch statement
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
- How can I vertically align my status bar item text
- Adding TapGestureRecognizer to UILabel in Swift
- Attempt to present UIAlertController on View Contr
- Swift - Snapshotting a view that has not been rend
I wrote this extension in Swift 5:
You can then call this in your UIViewControllers:
Using UIUserInterfaceStyle, first available in tvOS 10, we can check what appearance the user has set.
For example:
Also, if you're updating from a Xcode 7/tvOS 9.0 project you will need to include
UIUserInterfaceStyle
in yourinfo.plist
. New projects created with Xcode 8 already have this key included.