Search code examples
iosios6twitter

Combine Multiple Twitter Timelines Into Single Display - Dynamically


Is there a way you can dynamically combine multiple Twitter timelines into a single display? For example, I want to allow a user to set a preference for which timelines they want to be displayed, and then have the results displayed in a single table.

I have seen the posts regarding creating a list as a way to combine multiple twitter timelines into one request, and displaying that. But this is me predefining which timelines the user gets, and they display all or nothing.

I'd like each user to be able to pick between TimelineA, TimelineB, TimelineC. And then the table dynamically update to display only those chosen. I was hoping there was a means to manipulate the GET statuses/user_timeline parameter so that it would return results from multiple screen_name. But, I've not been able to sort it out.

I'm targeting iOS 6, using Twitter 1.1 API, and currently have a single timeline displaying successfully in a table, thanks to the Techotopia tutorial.

Thanks for any suggestions.


Solution

  • You can create an array containing the tweets from all the timelines sorted by a date parameter like created_at. You can sort this array using something like:

    How to sort an NSMutableArray with custom objects in it?

    This array would be your data source for a UITableView.