Today Extension height for iPad much larger than specified
Here's how to achieved this:
You should consider your constraint.
Your widgets default margin insets are not properly configured on the way you desired it, so setting this on your own is the only workaround here by calling 'widgetMarginInsetsForProposedMarginInsets:'
// Update widgets insets
func widgetMarginInsetsForProposedMarginInsets(defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets { println(NSStringFromUIEdgeInsets(defaultMarginInsets)) return UIEdgeInsetsMake(20, 20, 10, 20)}
Modified sample file link:Modified file
I had to hardcode the value of the widget on the viewDidLoad
delegate method in order to fix this:
import UIKitimport NotificationCenterclass TodayViewController: UIViewController, NCWidgetProviding { override func viewDidLoad() { super.viewDidLoad() self.preferredContentSize = CGSize(width: 0, height: 320) }}