-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
23 lines (21 loc) · 876 Bytes
/
README
File metadata and controls
23 lines (21 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#iOS5のTwitter.frameworkのサンプル
FNADetailViewController.m
TWTweetComposeViewControllerのサンプル簡単です
- (IBAction)tweete:(id)sender {
if (![TWTweetComposeViewController canSendTweet]){
// エラー処理
return ;
}
NSDictionary *shop = self.detailItem;
TWTweetComposeViewController *tvc = [[TWTweetComposeViewController alloc] init];
UIImage *image = self.photoImageView.image;
[tvc addImage:image];
[tvc setInitialText:[NSString stringWithFormat:@"『%@』 - ",[shop objectForKey:@"name"]]];
NSURL *url = [NSURL URLWithString:[[shop objectForKey:@"urls"] objectForKey:@"pc"]];
[tvc addURL:url];
tvc.completionHandler = ^(TWTweetComposeViewControllerResult result){
[self dismissModalViewControllerAnimated:YES];
};
[self presentModalViewController:tvc animated:YES];
}
参照