summaryrefslogtreecommitdiff
path: root/Juick/MessagesViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/MessagesViewController.m')
-rw-r--r--Juick/MessagesViewController.m32
1 files changed, 14 insertions, 18 deletions
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m
index 4361148..b77901b 100644
--- a/Juick/MessagesViewController.m
+++ b/Juick/MessagesViewController.m
@@ -12,7 +12,7 @@
#import "MessageCell.h"
#import "Message.h"
-#import "ColorsAndButtons.h"
+#import "ColorScheme.h"
#import "NewPostViewController.h"
@@ -80,14 +80,20 @@ static NSString *CellIdentifier = @"MessageCell";
{
[super viewDidLoad];
self.dataLoading = NO;
- [self.view setBackgroundColor:[ColorsAndButtons mainBackground]];
+ [self.view setBackgroundColor:[ColorScheme mainBackground]];
self.messages = [NSMutableArray array];
UIRefreshControl *refresh = [[UIRefreshControl alloc] init];
[refresh addTarget:self action:@selector(refreshData:) forControlEvents:UIControlEventValueChanged];
self.refreshControl = refresh;
-
- //UINib *cellNib = [UINib nibWithNibName:@"MessageCell" bundle:nil];
- //[self.tableView registerNib:cellNib forCellReuseIdentifier:@"MessageCell"];
+ SWRevealViewController *revealController = [self revealViewController];
+ if (revealController) {
+ // TODO: add to thread view too
+ [self.view addGestureRecognizer:[revealController panGestureRecognizer]];
+ }
+ if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1) {
+ self.navigationController.navigationBar.tintColor = [ColorScheme navbarBackground];
+ }
+
[self.tableView registerClass:[MessageCell class] forCellReuseIdentifier:CellIdentifier];
}
@@ -142,14 +148,10 @@ static NSString *CellIdentifier = @"MessageCell";
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+ MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[cell updateFonts];
Message *msg = [_messages objectAtIndex:indexPath.row];
[cell bind:msg];
- [cell setNeedsUpdateConstraints];
- [cell updateConstraintsIfNeeded];
- [cell.contentView setNeedsLayout];
- [cell.contentView layoutIfNeeded];
cell.bodyLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.bodyLabel.frame);
[cell.contentView layoutIfNeeded];
@@ -166,12 +168,6 @@ static NSString *CellIdentifier = @"MessageCell";
[cell bind:msg];
- [cell setNeedsUpdateConstraints];
- [cell updateConstraintsIfNeeded];
-
- [cell.contentView setNeedsLayout];
- [cell.contentView layoutIfNeeded];
-
cell.bodyLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.bodyLabel.frame);
[cell.contentView layoutIfNeeded];
@@ -182,9 +178,9 @@ static NSString *CellIdentifier = @"MessageCell";
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
{
- if (self.dataLoading) {
+ /* if (self.dataLoading) {
return [self tableView:tableView heightForRowAtIndexPath:indexPath];
- }
+ }*/
return 500.0f;
}