summaryrefslogtreecommitdiff
path: root/Juick/RevealPanelViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/RevealPanelViewController.m')
-rw-r--r--Juick/RevealPanelViewController.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/Juick/RevealPanelViewController.m b/Juick/RevealPanelViewController.m
index 7053832..ec575a0 100644
--- a/Juick/RevealPanelViewController.m
+++ b/Juick/RevealPanelViewController.m
@@ -6,9 +6,13 @@
// Copyright (c) 2013 com.juick. All rights reserved.
//
+#import "SWRevealViewController.h"
+
#import "RevealPanelViewController.h"
+#import "MessagesViewController.h"
#import "ColorsAndButtons.h"
+#import "NSURL+PathParameters.h"
@interface RevealPanelViewController ()
@@ -74,4 +78,26 @@
return cell;
}
+- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+ NSInteger row = indexPath.row;
+ NSURL *targetUrl;
+ NSString *targetTitle;
+ if (row == 1) {
+ targetTitle = @"Popular";
+ targetUrl = [[NSURL URLWithString:@"https://api.juick.com/messages"] URLByAppendingParameters:[NSDictionary dictionaryWithObjectsAndKeys:@"1", @"popular", nil]];
+ } else if (row == 2) {
+ targetTitle = @"Discover";
+ targetUrl = [NSURL URLWithString:@"https://api.juick.com/messages"];
+ }
+ if (row == 3) {
+ targetTitle = @"Images";
+ targetUrl = [[NSURL URLWithString:@"https://api.juick.com/messages"] URLByAppendingParameters:[NSDictionary dictionaryWithObjectsAndKeys:@"photo", @"media", nil]];
+ }
+ SWRevealViewController *reveal = self.revealViewController;
+ UINavigationController *front = (UINavigationController *)reveal.frontViewController;
+ MessagesViewController *messages = (MessagesViewController *)[front.viewControllers objectAtIndex:0];
+ [messages loadFromURL:targetUrl withTitle:targetTitle];
+ [reveal revealToggle:self];
+}
+
@end