我想添加这样的按钮以分享tweet:image
这就是我想打电话的内容
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]];
答案 0 :(得分:0)
您可以像这样向UINavigationItem
添加按钮:
- (void)loadView {
[super loadView];
UIImage *hearthImage = [UIImage imageNamed:@"heart" inBundle:[NSBundle bundleForClass:[self class]]];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:hearthImage style:UIBarButtonItemStylePlain target:self action:@selector(tapButton:)];
}
- (void) tapButton: (id) sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://twitter.com/intent/tweet?text=YOUR_TEXT_HERE"]]];
}