summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r--Juick/ViewControllers/ChatViewController.m4
-rw-r--r--Juick/ViewControllers/DialogsViewController.m7
-rw-r--r--Juick/ViewControllers/MessagesViewController.m2
3 files changed, 11 insertions, 2 deletions
diff --git a/Juick/ViewControllers/ChatViewController.m b/Juick/ViewControllers/ChatViewController.m
index cfecc48..9ca024c 100644
--- a/Juick/ViewControllers/ChatViewController.m
+++ b/Juick/ViewControllers/ChatViewController.m
@@ -34,12 +34,12 @@
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
[self reloadChat];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
- self.tableView.refreshControl = [UIRefreshControl new];
- [self.tableView.refreshControl addTarget:self action:@selector(reloadChat) forControlEvents:UIControlEventValueChanged];
[self addObserver:self forKeyPath:@"uname" options:0 context:nil];
#if TARGET_OS_MACCATALYST
[self.stack addArrangedSubview:[self inputAccessoryView]];
#else
+ self.tableView.refreshControl = [UIRefreshControl new];
+ [self.tableView.refreshControl addTarget:self action:@selector(reloadChat) forControlEvents:UIControlEventValueChanged];
self.stackBottomConstraint.constant = kMessageInputInitialHeight;
#endif
}
diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m
index 5f2dca9..dff8529 100644
--- a/Juick/ViewControllers/DialogsViewController.m
+++ b/Juick/ViewControllers/DialogsViewController.m
@@ -25,8 +25,11 @@
[super viewDidLoad];
[self.view setBackgroundColor:[UIColor colorNamed:@"Background"]];
[self.tableView registerNib:[UINib nibWithNibName:@"ConversationCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"notificationCell"];
+ self.tableView.rowHeight = UITableViewAutomaticDimension;
+#if !TARGET_OS_MACCATALYST
self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged];
+#endif
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil];
[self refreshData];
}
@@ -83,6 +86,10 @@
return cell;
}
+- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
+ return 84.0f;
+}
+
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:@"chatSegue" sender:self];
}
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index 7814d1e..cd4d740 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -118,8 +118,10 @@ NSString* const messageCellIdentifier = @"messageCell";
if (!self.messages) {
self.messages = [NSMutableArray array];
}
+#if !TARGET_OS_MACCATALYST
self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged];
+#endif
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newMessage:) name:NewMessageNotificationName object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil];
[self refreshData];