summaryrefslogtreecommitdiff
path: root/Juick/RevealPanelViewController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-11-07 12:18:27 +0400
committerGravatar Vitaly Takmazov2013-11-07 12:18:27 +0400
commitff23c4eb5d382d25c2e4779e0ea8f4b724651105 (patch)
treefe2c0e99608add7a851f797ab31d5e33b98de281 /Juick/RevealPanelViewController.m
parent8c69b5408e5d2870d60f15662f1d567e6cd55da7 (diff)
load public pages from reveal view
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