summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r--Juick/ViewControllers/FeedViewController.h2
-rw-r--r--Juick/ViewControllers/FeedViewController.m10
-rw-r--r--Juick/ViewControllers/MessagesViewController.h2
-rw-r--r--Juick/ViewControllers/MessagesViewController.m15
4 files changed, 17 insertions, 12 deletions
diff --git a/Juick/ViewControllers/FeedViewController.h b/Juick/ViewControllers/FeedViewController.h
index 76388aa..a669bcb 100644
--- a/Juick/ViewControllers/FeedViewController.h
+++ b/Juick/ViewControllers/FeedViewController.h
@@ -9,6 +9,6 @@
#import <UIKit/UIKit.h>
#import "MessagesViewController.h"
-@interface FeedViewController : MessagesViewController<MessagesDelegate, MessageCellDelegate>
+@interface FeedViewController : MessagesViewController<MessagesDelegate>
@end
diff --git a/Juick/ViewControllers/FeedViewController.m b/Juick/ViewControllers/FeedViewController.m
index c492f2e..3575f16 100644
--- a/Juick/ViewControllers/FeedViewController.m
+++ b/Juick/ViewControllers/FeedViewController.m
@@ -14,11 +14,6 @@
NSString * const UserNotAuthenticatedNotificationName = @"UserNotAuthenticated";
-@interface FeedViewController ()
-
-@property NSString *selectedUser;
-@end
-
@implementation FeedViewController
-(void) viewDidLoad {
@@ -29,11 +24,6 @@ NSString * const UserNotAuthenticatedNotificationName = @"UserNotAuthenticated";
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserChangedNotificationName object:nil];
}
--(void)avatarClicked:(NSString *)uname {
- self.selectedUser = uname;
- [self performSegueWithIdentifier:@"profileSegue" sender:self];
-}
-
-(void) loadMore {
Message *lastMsg = [self.messages lastObject];
if (lastMsg != nil) {
diff --git a/Juick/ViewControllers/MessagesViewController.h b/Juick/ViewControllers/MessagesViewController.h
index 3b466f0..6d2c7e2 100644
--- a/Juick/ViewControllers/MessagesViewController.h
+++ b/Juick/ViewControllers/MessagesViewController.h
@@ -15,7 +15,7 @@ extern NSString* const messageCellIdentifier;
-(void) loadMore;
@end
-@interface MessagesViewController : UITableViewController
+@interface MessagesViewController : UITableViewController<MessageCellDelegate>
@property(nonatomic, strong) NSString *path;
@property(nonatomic, strong) NSDictionary *params;
@property(nonatomic, assign) BOOL shouldScrollToUnreadOnRefresh;
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index 12f8176..10b7c37 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -27,6 +27,8 @@ NSString* const messageCellIdentifier = @"messageCell";
-(void) applicationActivated;
+@property NSString *selectedUser;
+
@end
@implementation MessagesViewController
@@ -155,6 +157,7 @@ NSString* const messageCellIdentifier = @"messageCell";
Message *msg = [self.messages objectAtIndex:indexPath.row];
MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:messageCellIdentifier forIndexPath:indexPath];
[cell configureWithMessage:msg selectable:self.shouldAllowToSelectText];
+ cell.delegate = self;
return cell;
}
}
@@ -219,6 +222,18 @@ NSString* const messageCellIdentifier = @"messageCell";
return configuration;
}
+-(void)avatarClicked:(NSString *)uname {
+ /*self.selectedUser = uname;
+ [self performSegueWithIdentifier:@"profileSegue" sender:self];*/
+}
+
+-(void)linkClicked:(NSString *)urlString {
+ NSURL *url = [NSURL URLWithString:urlString];
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
+
+ }];
+}
+
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];