summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/DialogsViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers/DialogsViewController.m')
-rw-r--r--Juick/ViewControllers/DialogsViewController.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m
index cbf0024..c2296dd 100644
--- a/Juick/ViewControllers/DialogsViewController.m
+++ b/Juick/ViewControllers/DialogsViewController.m
@@ -36,6 +36,10 @@
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:YES];
[self.tableView endUpdates];
+ self.tableView.backgroundView = [UIView new];
+ } else {
+ [self setEmptyMessageView:@"Sign in to view chats"];
+ [self.tableView reloadData];
}
[self.refreshControl endRefreshing];
}];
@@ -77,5 +81,18 @@
}
}
+- (void) setEmptyMessageView:(NSString *)message {
+ CGRect rect = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
+ UILabel *messageLabel = [[UILabel alloc] initWithFrame:rect];
+ messageLabel.text = message;
+ messageLabel.numberOfLines = 0;
+ messageLabel.textAlignment = NSTextAlignmentCenter;
+ messageLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCallout];
+ messageLabel.textColor = [UIColor colorNamed:@"Muted"];
+ [messageLabel sizeToFit];
+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+ [self.tableView setBackgroundView:messageLabel];
+}
+
@end