I have a today widget that contains two things:
- A
UILabel
- A
UITableView
In my viewWillAppear
I set the label to be visible and my tableView to be hidden and I set the label text to "Loading". See image below.
Then I get a location and when this is done, I call another method and
- If I do not find any data I just update the label text to "Did not find data"
- Otherwise I set the label to be hidden and the tableView to be visible and I start updating the data
When this is successfully done I have a tableView that looks like this:
.
To my issue now.
When I open my today widget and hit viewWillAppear
, I don´t always manage to set my label and the only result I get is this
.
So what happens is that I can only show a bit of my previous result in the tableView.
This happens occasionally and it seems that the tableView freezes and I´m not able to update the initial view, to hide the tableView and show the label instead. Even when the screen freezes like this everything is running like it should and I manage to update the tableView and the view.
The only issue is when I open the widget that the screen freezes like this:
sometimes instead of showing my label. The reason it´s in the size as it is, is because I set the preferredContentSize = CGSizeMake(0, 30)
. Otherwise I bet it will have shown the entire previous tableView.
Any ideas of how to solve this, to always update the view when I hit viewWillAppear
?
Update
Starting another bounty to see if there is some other input on this issue.
reload()
table view ? and hide label. If you add some of the implementation maybe i can help you – DepilatoryNCWidgetProviding
protocol and implementingwidgetMarginInsetsForProposedMarginInsets:
already? – Ingrained