Skip to content

Instantly share code, notes, and snippets.

@tomohisa
Created April 10, 2012 23:11
Show Gist options
  • Save tomohisa/2355465 to your computer and use it in GitHub Desktop.
Save tomohisa/2355465 to your computer and use it in GitHub Desktop.
Check and open Twitter URL Scheme
NSString *str = [NSString stringWithFormat:@"twitter://user?screen_name=%@", bstr];
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:str]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}else {
UIAlertView*alert = [[UIAlertView alloc] initWithTitle:@"Tweetoverview" message:NSLocalizedString(@"Can not open twitter app. Please install twitter app to send tweet.", @"Can not open twitter app. Please install twitter app to send tweet.") delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];
[alert show];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment