|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "CNONRootListController.h"
-
- @implementation CNONRootListController
-
- - (NSArray *)specifiers {
- if (!_specifiers) {
- _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
- }
-
- return _specifiers;
- }
-
- -(void)openTwitter {
- NSURL *url;
-
- // check which of these apps are installed
- if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tweetbot:"]]) {
- url = [NSURL URLWithString:@"tweetbot:///user_profile/Ra1nPix"];
- }
- else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitterrific:"]]) {
- url = [NSURL URLWithString:@"twitterrific:///profile?screen_name=Ra1nPix"];
- }
- else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tweetings:"]]) {
- url = [NSURL URLWithString:@"tweetings:///user?screen_name=Ra1nPix"];
- }
- else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter:"]]) {
- url = [NSURL URLWithString:@"twitter://user?screen_name=Ra1nPix"];
- }
- else {
- url = [NSURL URLWithString:@"https://mobile.twitter.com/Ra1nPix"];
- }
-
- // open my profile in the app chosen above
- // if you're compiling with an iOS 10 or lower sdk you can leave out options:@{} and completionHandler:nil
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
- }
-
- // send respring notification
- -(void)saveTapped {
- [self.view endEditing:YES];
- CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("com.yaypixxo.cnon/respring"), NULL, NULL, YES);
- }
-
- @end
|