From ff23c4eb5d382d25c2e4779e0ea8f4b724651105 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 7 Nov 2013 12:18:27 +0400 Subject: load public pages from reveal view --- Juick/MessagesViewController.m | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Juick/MessagesViewController.m') diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index 55f8a19..6c594ba 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -32,13 +32,11 @@ static NSString *CellIdentifier = @"MessageCell"; @implementation MessagesViewController -- (id)initWithURL:(NSURL *)messagesURL +- (void)loadFromURL:(NSURL *)messagesURL withTitle:(NSString *)title { - self = [super init]; - if (self) { - self.url = messagesURL; - } - return self; + [self setUrl:messagesURL]; + self.title = title; + [self refreshData:nil]; } - (void) refreshData:(UIRefreshControl *)refresh { @@ -95,7 +93,6 @@ static NSString *CellIdentifier = @"MessageCell"; { [super viewDidLoad]; self.dataLoading = NO; - self.title = @"Discover"; [self.view setBackgroundColor:[ColorsAndButtons mainBackground]]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { SWRevealViewController *revealController = [self revealViewController]; @@ -114,7 +111,8 @@ static NSString *CellIdentifier = @"MessageCell"; //UINib *cellNib = [UINib nibWithNibName:@"MessageCell" bundle:nil]; //[self.tableView registerNib:cellNib forCellReuseIdentifier:@"MessageCell"]; - [self.tableView registerClass:[MessageCell class] forCellReuseIdentifier:CellIdentifier]; + [self.tableView registerClass:[MessageCell class] forCellReuseIdentifier:CellIdentifier]; + [self loadFromURL:[NSURL URLWithString:@"https://api.juick.com/messages"] withTitle:@"Discover"]; } -- cgit v1.2.3