title: Today Widget Extension Height - iOS10
body: <p>The height for the Today's widget view mode cannot be set for compact Mode. No matter whatever value I set. It sets the height of the widget to a default value. The expanded mode works perfect and the value is properly set and reflected in the widget.
  I have already added this line in my viewDidLoad() method.</p>
  
  <pre><code>self.extensionContext?.widgetLargestAvailableDisplayMode = .expanded
  </code></pre>
  
  <p>Here is the code. The value of maxSize cannot be changed too as its a constant.</p>
  
  <pre><code>func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
  
          //self.preferredContentSize = (activeDisplayMode == .compact) ? maxSize : CGSize(width: maxSize.width, height: 300)
  
          if activeDisplayMode == NCWidgetDisplayMode.compact
          {
               self.preferredContentSize = CGSize(width: maxSize.width, height: 300)
          }
          else
          {
              self.preferredContentSize = CGSize(width: maxSize.width, height: 560)
          }
  }
  </code></pre>