From 985cef6b494a4a8ced7b839f73bfbba578ebdeec Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 19 Nov 2019 18:16:03 -0600 Subject: [PATCH] Remove title from timeline back button. Issue #1319 --- iOS/MasterFeed/MasterFeedViewController.swift | 5 ++++- iOS/MasterTimeline/MasterTimelineViewController.swift | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 1941a7aa2..f31a16525 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -39,7 +39,10 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner { } navigationItem.rightBarButtonItem = editButtonItem - + + // Set the bar button item so that it doesn't show on the timeline view + navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) + // If you don't have an empty table header, UIKit tries to help out by putting one in for you // that makes a gap between the first section header and the navigation bar var frame = CGRect.zero diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 379fe1fd6..e1ec464b8 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -72,8 +72,8 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner applyChanges(animated: false) // Set the bar button item so that it doesn't show on the article view - navigationItem.backBarButtonItem = UIBarButtonItem() - + navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) + // Restore the scroll position if we have one stored if let restoreIndexPath = coordinator.timelineMiddleIndexPath { tableView.scrollToRow(at: restoreIndexPath, at: .middle, animated: false)