Update the nav controller title so that the back bar button item in iPad portrait has a valid title

This commit is contained in:
Maurice Parker 2019-04-28 18:53:57 -05:00
parent ebd97b030a
commit bf50c7a7e3
3 changed files with 9 additions and 27 deletions

View File

@ -10,10 +10,10 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Master--> <!--Feeds-->
<scene sceneID="pY4-Hu-kfo"> <scene sceneID="pY4-Hu-kfo">
<objects> <objects>
<navigationController storyboardIdentifier="MasterNavigationViewController" title="Master" useStoryboardIdentifierAsRestorationIdentifier="YES" toolbarHidden="NO" id="RMx-3f-FxP" sceneMemberID="viewController"> <navigationController storyboardIdentifier="MasterNavigationViewController" title="Feeds" useStoryboardIdentifierAsRestorationIdentifier="YES" toolbarHidden="NO" id="RMx-3f-FxP" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" largeTitles="YES" id="Pmd-2v-anx"> <navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" largeTitles="YES" id="Pmd-2v-anx">
<rect key="frame" x="0.0" y="44" width="414" height="96"/> <rect key="frame" x="0.0" y="44" width="414" height="96"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
@ -140,7 +140,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FJe-Yq-33r" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="FJe-Yq-33r" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="900" y="763"/> <point key="canvasLocation" x="1151" y="-23"/>
</scene> </scene>
<!--Timeline--> <!--Timeline-->
<scene sceneID="fag-XH-avP"> <scene sceneID="fag-XH-avP">
@ -190,27 +190,7 @@
</tableViewController> </tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="nzm-Gf-Xce" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="nzm-Gf-Xce" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="900" y="-42"/> <point key="canvasLocation" x="1620" y="-759"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="uQv-y4-hI4">
<objects>
<navigationController storyboardIdentifier="MasterTimelineNavigationViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" toolbarHidden="NO" id="vHh-eJ-Wug" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Df0-za-Olh">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Tqe-Na-Jew">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<autoresizingMask key="autoresizingMask"/>
</toolbar>
<connections>
<segue destination="Kyk-vK-QRX" kind="relationship" relationship="rootViewController" id="g8t-I4-iBe"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Kif-ju-wKR" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="154" y="-42"/>
</scene> </scene>
<!--Split View Controller--> <!--Split View Controller-->
<scene sceneID="Nki-YV-4Qg"> <scene sceneID="Nki-YV-4Qg">
@ -226,10 +206,10 @@
</objects> </objects>
<point key="canvasLocation" x="-856" y="-330"/> <point key="canvasLocation" x="-856" y="-330"/>
</scene> </scene>
<!--Master--> <!--Feeds-->
<scene sceneID="smW-Zh-WAh"> <scene sceneID="smW-Zh-WAh">
<objects> <objects>
<tableViewController storyboardIdentifier="MasterViewController" title="Master" useStoryboardIdentifierAsRestorationIdentifier="YES" clearsSelectionOnViewWillAppear="NO" id="7bK-jq-Zjz" customClass="MasterFeedViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController"> <tableViewController storyboardIdentifier="MasterViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" clearsSelectionOnViewWillAppear="NO" id="7bK-jq-Zjz" customClass="MasterFeedViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="r7i-6Z-zg0"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="r7i-6Z-zg0">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -304,7 +284,7 @@
</navigationController> </navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="SLD-UC-DBI" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="SLD-UC-DBI" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="154" y="763"/> <point key="canvasLocation" x="345" y="-23"/>
</scene> </scene>
</scenes> </scenes>
<resources> <resources>

View File

@ -49,6 +49,7 @@ class MasterFeedViewController: ProgressTableViewController, UndoableCommandRunn
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
clearsSelectionOnViewWillAppear = splitViewController!.isCollapsed clearsSelectionOnViewWillAppear = splitViewController!.isCollapsed
navigationController?.title = NSLocalizedString("Feeds", comment: "Feeds")
super.viewWillAppear(animated) super.viewWillAppear(animated)
} }

View File

@ -348,6 +348,7 @@ private extension MasterTimelineViewController {
updateTableViewRowHeight() updateTableViewRowHeight()
title = navState?.timelineName title = navState?.timelineName
navigationController?.title = navState?.timelineName
if navState?.articles.count ?? 0 > 0 { if navState?.articles.count ?? 0 > 0 {
tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false) tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false)