Display something other than empty table when no tweets returned



It seems that if we configure a data source (usually TWTRSearchTimelineDataSource), and display it with the standard TwitterKit TWTRTimelineViewController, that if the data source doesn’t retrieve any content, the controller simply displays an empty table. This is not a great user experience.

It would be great if at least one of the following were true:

  1. The stock timeline controller handled the case where loading content does not succeed, and displayed a message to the user.
  2. The timeline controller had some kind of delegate object that it notified whenever it finished attempting to load content, after the table view state is updated. Ideally, this would include error details in the case where the load failed. But at least something we could use to check whether the table was empty or not, and manage a substitute UI.
  3. There existed some way to listen to / interact with the data source object after it’s been configured at handed off to the timeline controller. There’s a callback block it calls when a request to load content succeeds, but no mechanism for propagating that information anywhere but the object that initiated the load (which, in this case, is opaque).

(For the record: in our specific case, the particular content to be displayed is controlled by our users, so we can’t prevent this by hand-selecting popular hashtags, or whatever.)


For what it’s worth, while I’ve written this from the standpoint of an iOS developer, I believe the same issue exists on Android, and needs solving there, too.


Thanks for the feedback on this @sfko and I’ll definitely raise this up with the team. I am personally curious though, what is the content that your users are choosing to display?


Could be a number of things, but the one that runs into this case most often is an event-related hashtag that no one is using yet / any more. It’s understandable that the search API wouldn’t be able to return content in those cases, but we’d like those users to know that, rather than wondering whether the app is busted.


Totally makes sense @sfko, really appreciate those details. I’m going to chat with the eng/product team and see what can be done in this case.


For the record: it seems that over the past several releases of TwitterKit, Twitter has taken some solid steps to address these concerns.

I noticed that in 2.4.0, the timeline displays a message when it doesn’t get any tweets to display. While it does not display any message when the request fails outright, the addition of the TWTRTimelineDelegate protocol and the countOfTweets property enables us to roll our own UI for that.

So, thank you! We appreciate it.


Thanks for continuing to push on making it better :slight_smile: