Search code examples
iosxcodeswiftios8today-extension

Maximum height of iOS 8 Today Extension?


I am working on a Today Extension with a dynamically sized table. I have been able to get the table to resize for the content using:

    self.preferredContentSize = accountsTable.contentSize

However, I have found that it will not get taller than a certain size (568 px) even though I can tell the table contentSize is larger.

I'm not clear if this is a built-in limit or if there is a way around this to make a larger view. It appears that some previous extensions (Stocks widget) is able to become larger.

Anyone else running into the same behavior. Anyone know if it's possible to make an extension appear larger either immediately or using a "Show All" button like the Stock widget?


Solution

  • I made some tests and you can calculate the maximum height of your Today Extension with this formular:

    for iPhone:

    float maxHeight = [[ UIScreen mainScreen ] bounds ].size.height - 126;
    

    for iPad:

    float maxHeight = [[ UIScreen mainScreen ] bounds ].size.height - 171;
    

    This should work for alle Screen sizes...