I have implemented the new widget for iOS 10 and I have used the following code to set the height for it:
@available(iOSApplicationExtension 10.0, *)
func widgetActiveDisplayModeDidChange(activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
if activeDisplayMode == NCWidgetDisplayMode.Compact {
self.preferredContentSize = CGSizeMake(0.0, 350.0)
}
else if activeDisplayMode == NCWidgetDisplayMode.Expanded {
self.preferredContentSize = desiredSize
}
}
And it´s working fine, but my issue is with the "Show more" and "Show less" buttons. They don't always respond and I do very often have to click more than once to trigger them. I´m I missing something? Do I have to add more than the above code to handle the height?