No way to access preferredContentSizeCategory in Widget
||Date Originated:||19-Apr.-2017 03:58 PM|
|Product:||iOS + SDK
||Product Version:||Xcode 8.3.1 (8E1000a)|
When creating a today widget there is no way to get the preferredContentSizeCategory in iOS 10.3.
The underlying problem is that UIApplication.shared is not available in widgets, and that this is the only official way to access the currently selected content size category of the user.
Steps to Reproduce:
1) create a today widget target in Xcode
2) try to access the current preferredContentSizeCategory in -viewDidLoad or somewhere else
It´s possible to access preferredContentSizeCategory in the widget
Compiler error: „UIApplication.shared“ is unavailable and there’s no other way to access the current preferredContentSizeCategory
Xcode 8.3.1 (8E1000a)
Notification „UIContentSizeCategoryDidChange“ works fine to be notified about changes of the preferredContentSizeCategory, but we need to access the current preferredContentSizeCategory when the widget is started, not only when a change happens
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!