title: Size problems by converting iOS 9 today extension to iOS 10
body: <p>Good evening!</p>
  
  <p>I have big problems by understanding today extensions. I've read lot of tutorials and introductions but nothing helped me to understanding the problem. On iOS 9 the extension works fine - on iOS 10 not.</p>
  
  <p>My big issue is the auto resizing(?) of the widget in iOS 10. On iOS 9 the widget show my table view in portrait and landscape perfect - iOS 10 crash that organization and break the view. The question on StackOverflow about that has only the answers like that: <a href="https://stackoverflow.com/a/38009125">https://stackoverflow.com/a/38009125</a></p>
  
  <p>But I won't display a button with "more" / "less". My extension should only display my tableView in a specific height, not more, not less.</p>
  
  <p>The today extension that I use to test (I will build a similar extension with a table view if it works) is that: <a href="https://github.com/maximbilan/iOS-Today-Extension-Simple-Tutorial" rel="nofollow noreferrer">https://github.com/maximbilan/iOS-Today-Extension-Simple-Tutorial</a> (It's not my code - I'm happy about the work of the publisher!)</p>
  
  <p>Here are two pictures of the problem (1. iOS 9, 2. iOS 10):</p>
  
  <p><a href="https://i.stack.imgur.com/fptlH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fptlH.png" alt="iOS 9: work"></a></p>
  
  <p><a href="https://i.stack.imgur.com/9VuLm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9VuLm.png" alt="iOS 10: bug"></a></p>
  
  <p>I don't understand what is the problem. I set the height with <code>self.preferredContentSize.height = 200</code> but iOS 10 dont use that height like iOS 9. And the StackOverflow answer above is not a solution because I won't a more / less button. Although I use the code of the more / less button the problem exist anymore in compact size:</p>
  
  <pre><code>// ViewDidLoad
  if #available(iOSApplicationExtension 10.0, *) {
          self.extensionContext?.widgetLargestAvailableDisplayMode = NCWidgetDisplayMode.expanded
      } else {
          self.preferredContentSize.height = 200
      }
  
  // method in File
  @available(iOSApplicationExtension 10.0, *)
  func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
      if (activeDisplayMode == NCWidgetDisplayMode.compact) {
          self.preferredContentSize = maxSize
      }
      else {
          self.preferredContentSize = CGSize(width: maxSize.width, height: 200)
      }
  }
  </code></pre>
  
  <p>As I said above - this code work only if the widget is pressed as "show more"... If the button is not pressed and the widget is in compact size it looks like the image above.</p>
  
  <p>I hope anybody can help me because that is a problem I have for a really long time and I don't find enough material about today widgets on iOS 10.</p>
  
  <p>Thanks!</p>