My open source library should be able to call UIApplication.shared.preferredContentSizeCategory . But UIApplication.shared not available in extensions. The build error says that I find a method based on the view of the controller to solve my problem, but I am writing a library, so I do not have access to any view controllers. Is there a way to get the extension root view controller or a way to get an external UITraitEnvironment ?
I support iOS 9+, but this feature can be 10+ if that allows.
source share