Test bar disabled. Header div remains.

The Blog

Twitter Follow Button for iOS / iPhone – Code

I was looking for an easy way to link to your Twitter profile in a user’s Twitter Application of choice from an iOS App. There were lots of handy resources, but no complete solution for iPhone so I coded one up and threw it on GitHub: Twitter Follow Button for iOS

It’s pretty simple to use:

[self.view addSubview:[[FollowMeButton alloc] initWithTwitterAccount:
@"chrismaddern" atOrigin:CGPointMake(205, 248) isSmallButton:YES]];
									

Or you can just change the class of a UIButton in the Interface Builder and then synthesise it as a property.

I hope that this helps some people out!

 

Go to the GitHub
Just download the code

Credit where credit’s due!

This is largely several others’ work pulled together to create a simple-to-include repo.

Hi-Res Follow Me button created by Joseph DiPaolo:

http://www.illustrated-primer.com/blog/2011/06/19/twitter-follow-buttons/

Non-Twitter App Schemes from the Gist Repo:

https://gist.github.com/958738 Created by vhbit

Thanks to HandleOpenURL for documenting the Twitter iOS5 Scheme http://handleopenurl.com/scheme/twitter

Discussion

Tags: , , , , , ,

About Chris

Chris is an entrepreneur, engineer and occasional writer here, and at the iPhone App Cafe. He uses and writes about a variety of platform and languages but is mostly focussed on iPhone and PHP-hacked-together services to support Apps.

2 Twitter Comments So Far

  1. Chris Maddern (@chrismaddern) (@chrismaddern)
    February 18, 2012 at 5:36 pm #

    Add a Twitter Follow button to your iOS App using the iOS5 Twitter App or their Twitter App of choice! http://t.co/wvLvop6d #code #github

  2. Chris Maddern (@chrismaddern) (@chrismaddern)
    February 18, 2012 at 10:02 pm #

    Twitter Follow button for iPhone http://t.co/tV1WFs6Y

Caution: divs may fall without warning! (Currently in development)

Follow

Get every new post delivered to your Inbox

Join other followers: