My Today extension needs to have a dynamic height based on the contents the widget is displaying. I was able to achieve this by adding a constraint on my bottom-most element: bo
I had to hardcode the value of the widget on the viewDidLoad
delegate method in order to fix this:
import UIKit
import NotificationCenter
class TodayViewController: UIViewController, NCWidgetProviding {
override func viewDidLoad() {
super.viewDidLoad()
self.preferredContentSize = CGSize(width: 0, height: 320)
}
}