After trying this to dynamically resize my UITableView according to its contents size and failing:
self.tableViewPairedDevices.sizeToFit()
I tried this which worked fine as long as my Today Widget is tall enough to show it entirely:
var frame:CGRect = self.tableViewPairedDevices.frame
frame.size.height = self.tableViewPairedDevices.contentSize.height
self.tableViewPairedDevices.frame = frame
My next challenge was to get my iOS 8 Today Widget to resize according to the UITableView size, which I almost solved with:
self.preferredContentSize = self.tableViewPairedDevices.contentSize;
self.tableViewPairedDevices.setTranslatesAutoresizingMaskIntoConstraints(false)
The problem is that only one of them works at a time, if the UITableView gets resized, the extension's view doesn't, if I comment out the code that resizes the UITableView, the Today Extension gets resized successfully (the weird thing is that it knows what size the UITableView should be, even though the UITableView itself hasn't been resized) but the UITableView doesnt.
Any suggestions on how to achieve both things?
Thanks a lot!