I am struggling to change the height of my iOS 10 widget in compact mode.
All I have is an empty widget, no views inside it. Still, no matter what I set for the compact height, it seems to ignore it.
Here is my code:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self.extensionContext setWidgetLargestAvailableDisplayMode:NCWidgetDisplayModeExpanded];
}
- (void)widgetActiveDisplayModeDidChange:(NCWidgetDisplayMode)activeDisplayMode withMaximumSize:(CGSize)maxSize{
if (activeDisplayMode == NCWidgetDisplayModeCompact) {
self.preferredContentSize = CGSizeMake(0, 50);
}
else{
self.preferredContentSize = CGSizeMake(0, 200);
}
}
Could this be an issue with beta software? I am on Xcode 8 beta and iOS 10 beta 7.