diff options
Diffstat (limited to 'Juick/MessagesViewController.m')
-rw-r--r-- | Juick/MessagesViewController.m | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index 1fb4ece..2f5cc29 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -95,12 +95,13 @@ static NSString *CellIdentifier = @"MessageCell"; self.dataLoading = NO; self.title = @"Discover"; [self.view setBackgroundColor:[ColorsAndButtons mainBackground]]; - SWRevealViewController *revealController = [self revealViewController]; - [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; - UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { + SWRevealViewController *revealController = [self revealViewController]; + [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; + UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)]; - - self.navigationItem.leftBarButtonItem = revealButtonItem; + self.navigationItem.leftBarButtonItem = revealButtonItem; + } self.messages = [NSMutableArray array]; UIRefreshControl *refresh = [[UIRefreshControl alloc] init]; [refresh addTarget:self action:@selector(refreshData:) forControlEvents:UIControlEventValueChanged]; @@ -198,5 +199,13 @@ static NSString *CellIdentifier = @"MessageCell"; return 100.0f; } +-(void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { + self.navigationItem.leftBarButtonItem = nil; +} + +-(void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc { + self.navigationItem.leftBarButtonItem = barButtonItem; +} + @end |