diff options
author | Vitaly Takmazov | 2019-03-22 00:33:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-22 00:33:30 +0300 |
commit | 5f4a09ec689cb04ce71b4eb7425936f04a70f6f4 (patch) | |
tree | 9653dc543bd8f47dbfa853cd36ace63206efc983 /Juick/ViewControllers/DialogsViewController.m | |
parent | 6e49fc5c4273e7597925c133c3a6985b6ad85ecc (diff) |
Fix sign in
Diffstat (limited to 'Juick/ViewControllers/DialogsViewController.m')
-rw-r--r-- | Juick/ViewControllers/DialogsViewController.m | 17 |
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 |