From 633abd8498f2ef52d7e2989e111d55012053ad74 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 2 Oct 2019 19:06:38 +0300 Subject: Cleanup titles --- Juick/ViewControllers/DialogsViewController.m | 5 ++++- Juick/ViewControllers/DiscoverViewController.m | 1 - Juick/ViewControllers/DiscussionsController.m | 1 - Juick/ViewControllers/FeedViewController.m | 1 - Juick/ViewControllers/MessagesViewController.m | 4 ++++ Juick/ViewControllers/ThreadViewController.m | 1 - 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m index 31a4e8b..0ac22df 100644 --- a/Juick/ViewControllers/DialogsViewController.m +++ b/Juick/ViewControllers/DialogsViewController.m @@ -15,7 +15,6 @@ @implementation DialogsViewController - (void)viewDidLoad { [super viewDidLoad]; - self.navigationController.visibleViewController.title = @"Chats"; [self.view setBackgroundColor:[UIColor colorNamed:@"Background"]]; [self.tableView registerNib:[UINib nibWithNibName:@"ConversationCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"notificationCell"]; [self refreshData]; @@ -23,6 +22,10 @@ [self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged]; } +- (void)viewWillAppear:(BOOL)animated { + self.navigationController.visibleViewController.title = self.title; +} + - (void) refreshData { self.chats = [NSMutableArray array]; [self.tableView reloadData]; diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m index 2b69c6f..7bf9f74 100644 --- a/Juick/ViewControllers/DiscoverViewController.m +++ b/Juick/ViewControllers/DiscoverViewController.m @@ -19,7 +19,6 @@ self.title = @"Discover"; self.path = [APIClient messagesUrl]; [self setShouldScrollToUnreadOnRefresh:NO]; - self.navigationController.visibleViewController.title = @"Discover"; [super viewDidLoad]; } diff --git a/Juick/ViewControllers/DiscussionsController.m b/Juick/ViewControllers/DiscussionsController.m index 03226ae..607ac26 100644 --- a/Juick/ViewControllers/DiscussionsController.m +++ b/Juick/ViewControllers/DiscussionsController.m @@ -20,7 +20,6 @@ self.title = @"Discussions"; self.path = [APIClient discussionsUrl]; [self setShouldScrollToUnreadOnRefresh:NO]; - self.navigationController.visibleViewController.title = @"Discussions"; [super viewDidLoad]; } diff --git a/Juick/ViewControllers/FeedViewController.m b/Juick/ViewControllers/FeedViewController.m index f1fdb0a..da1b914 100644 --- a/Juick/ViewControllers/FeedViewController.m +++ b/Juick/ViewControllers/FeedViewController.m @@ -25,7 +25,6 @@ NSString * const UserNotAuthenticatedNotificationName = @"UserNotAuthenticated"; -(void) viewDidLoad { self.messagesDelegate = self; - self.navigationController.visibleViewController.title = @"Today"; [self refreshPath]; [self setShouldScrollToUnreadOnRefresh:NO]; [super viewDidLoad]; diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 5dfbf8f..25a2ca5 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -25,6 +25,10 @@ NSString* const messageCellIdentifier = @"messageCell"; @implementation MessagesViewController +- (void)viewWillAppear:(BOOL)animated { + self.navigationController.visibleViewController.title = self.title; +} + -(void) refreshData { if ([self.path length] > 0) { self.dataLoading = YES; diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m index 60a115f..646dbc4 100644 --- a/Juick/ViewControllers/ThreadViewController.m +++ b/Juick/ViewControllers/ThreadViewController.m @@ -16,7 +16,6 @@ -(void) viewDidLoad { - [self setTitle:@"Thread"]; [self setPath:[APIClient threadUrl]]; [super viewDidLoad]; self.messagesDelegate = self; -- cgit v1.2.3