Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Source/Classes/TWViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#import "TWViewController.h"

#define ERROR_TITLE_MSG @"Whoa, there cowboy"
#define ERROR_NO_ACCOUNTS @"You must add a Twitter account in Settings.app to use this demo."
#define ERROR_PERM_ACCESS @"We weren't granted access to the user's accounts"
#define ERROR_NO_KEYS @"You need to add your Twitter app keys to Info.plist to use this demo.\nPlease see README.md for more info."
#define ERROR_OK @"OK"
Expand Down Expand Up @@ -92,9 +91,9 @@ - (void)loadView
self.view = view;
}

- (void)viewWillAppear:(BOOL)animated
- (void)viewDidAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[super viewDidAppear:animated];
[self refreshTwitterAccounts];
}

Expand Down Expand Up @@ -156,8 +155,13 @@ - (void)refreshTwitterAccounts
[alert show];
}
else if (![TWAPIManager isLocalTwitterAccountAvailable]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:ERROR_TITLE_MSG message:ERROR_NO_ACCOUNTS delegate:nil cancelButtonTitle:ERROR_OK otherButtonTitles:nil];
[alert show];
TWTweetComposeViewController *tweetView = [[TWTweetComposeViewController alloc] init];
tweetView.view.hidden = YES;
tweetView.completionHandler = ^(TWTweetComposeViewControllerResult result) {
[self dismissModalViewControllerAnimated:NO];
};
[self presentModalViewController:tweetView animated:NO];
[tweetView.view endEditing:YES];
}
else {
[self obtainAccessToAccountsWithBlock:^(BOOL granted) {
Expand Down