We have a working widget extension, for many years, works on iOS 12 and 13 these days. It sizes itself based on the sizes reported by widgetMaximumSizeForDisplayMode and widgetActiveDisplayModeDidChange.
On iOS 14 betas 1, 2, and now 3, the system reported sizes are incorrect. For instance on the iPhone 11 Pro Max simulator it initially reports 398, 110 which is way too wide. After I swipe out and then back to reload all widget extensions, it then reports 398, 102, also too wide. Finally after enough forced reloading, it reports the correct sizing 360, 110, the correct size. So basically, the widget is incorrectly sized most of the time.
Oddly, I added tens of widget extensions to my list to see who else is having this issue, and I did not see others suffering from it. Possibly, this is because I'm using the iOS 14 SDK and thus causing iOS 14 to treat my app as if I'm supposed to know some secret new sizing technique that I do not.
The new WidgetKit stuff is incompatible with the fairly interactive model for our widget, so I need to get the extension working by fixing this sizing issue while hoping WidgetKit matures for next year.
Perhaps this is a beta bug? If so, past experience dictates it would have been fixed by now and I always get bitten thinking things are such obvious beta bugs that they will be fixed. The fact that other widget extensions are generally working though indicates perhaps there is some other way to get the correct size (it does seem very strange that I'm not aware of an auto-layout way to handle this and I'm still being passed raw sizes?), or perhaps I can cause the system to re-layout then pass me the correct size.
Any ideas on this?
On iOS 14 betas 1, 2, and now 3, the system reported sizes are incorrect. For instance on the iPhone 11 Pro Max simulator it initially reports 398, 110 which is way too wide. After I swipe out and then back to reload all widget extensions, it then reports 398, 102, also too wide. Finally after enough forced reloading, it reports the correct sizing 360, 110, the correct size. So basically, the widget is incorrectly sized most of the time.
Oddly, I added tens of widget extensions to my list to see who else is having this issue, and I did not see others suffering from it. Possibly, this is because I'm using the iOS 14 SDK and thus causing iOS 14 to treat my app as if I'm supposed to know some secret new sizing technique that I do not.
The new WidgetKit stuff is incompatible with the fairly interactive model for our widget, so I need to get the extension working by fixing this sizing issue while hoping WidgetKit matures for next year.
Perhaps this is a beta bug? If so, past experience dictates it would have been fixed by now and I always get bitten thinking things are such obvious beta bugs that they will be fixed. The fact that other widget extensions are generally working though indicates perhaps there is some other way to get the correct size (it does seem very strange that I'm not aware of an auto-layout way to handle this and I'm still being passed raw sizes?), or perhaps I can cause the system to re-layout then pass me the correct size.
Any ideas on this?