Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to Embed Twitter Timeline/Tweet into card scroll view app

iamDeondraeiamDeondrae LondonPosts: 1New Users Noob
I am working on a app that uses card scroll view (meaning its a single screen but you can scroll through a set of card like views).

I want to be able to retrieve information from a tweet I post and put that information onto a single card view. So basically whenever I tweet something the app generates a new card with that tweet on it.

image/gif of the card scroll view is added.


I have already found a tutorial which I used to practice of how to embed the whole timeline of an account http://www.techotopia.com/index.php/An_iOS_6_iPhone_Twitter_Integration_Tutorial_using_SLRequest BUT I'm trying to embed a single new tweet onto this card view I already have.

The card scroll view style code can be found here https://github.com/alfonsomiranda/CardScrollView

Yes I have read about the twitter API's, tutorials on how to implement api's but I'm asking for whether someone can point me in the right direction as to how to merge these two in the links I provided... So whenever I send a tweet from the account chosen, the app generates a new card with that tweet on top of the card.

Here is the most basic usage using the block syntax to retrieve a single tweet.

NSString *myConsumerKey = @";"; //set this to your consumer key from twitter
NSString *myConsumerSecret = @";"; //set this to your consumer secret from twitter
[AFTweetFetcher setConsumerKey:myConsumerKey andConsumerSecret:myConsumerSecret];
[AFTweetFetcher getMostRecentTweetFor:@NASA then:^(*AFTweet tweet){
//do whatever you'd like to do with the tweet here.
NSLog(@%@ - %@ on %@", tweet.text, tweet.author, tweet.postDate);
}];
You can also use a delegate instead of the block syntax:

NSString *myConsumerKey = @";"; //set this to your consumer key from twitter
NSString *myConsumerSecret = @";"; //set this to your consumer secret from twitter
[AFTweetFetcher setConsumerKey:myConsumerKey andConsumerSecret:myConsumerSecret];
[AFTweetFetcher setDelegate:self];
[AFTweetFetcher get:3 mostRecentTweetsFor:@NASA]; //block not required
Sign In or Register to comment.