下面資料Tweet像TwitterCore.framework,TwitterKit.framework,Fabric.framework twitter.developer
2.附加的Twitter框架使用SDK
1. Crearte應用,TwitterKitResources.bundle
3.寫推特按鈕中的代碼
[[Twitter sharedInstance] startWithConsumerKey:@"YourConsumerKey" consumerSecret:@"YourConsumerSecret"];
[Fabric with:@[[Twitter sharedInstance]]];
[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error)
{
if (session)
{
NSLog(@"logged in user with id %@", session.userID);
TWTRComposer *composer = [[TWTRComposer alloc] init];
[composer setText:@"Enter Your Tweet Message"];
//[composer setImage:[UIImage imageNamed:@"fabric"]];
[composer showFromViewController:self completion:^(TWTRComposerResult result) {
if (result == TWTRComposerResultCancelled)
{
NSLog(@"Tweet composition cancelled");
}
else
{
NSLog(@"Sending Tweet!");
UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"" message:@"Sent Tweet!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[warningAlert show];
}
}];
}
else
{
// log error
}
}];