Remove duplicate split view controller initialization on launch

This commit is contained in:
Maurice Parker 2019-07-26 09:58:46 -05:00
parent 125512f551
commit 306af515ea
3 changed files with 15 additions and 42 deletions

View File

@ -103,7 +103,6 @@ class AppCoordinator: NSObject, UndoableCommandRunner {
}
}
private(set) var showFeedNames = false
private(set) var showAvatars = false
@ -456,13 +455,19 @@ class AppCoordinator: NSObject, UndoableCommandRunner {
currentArticleIndexPath = indexPath
} else {
let targetSplit = targetSplitForDetail()
let detailViewController = UIStoryboard.main.instantiateController(ofType: DetailViewController.self)
detailViewController.coordinator = self
let detailNavController = UINavigationController(rootViewController: detailViewController)
detailNavController.isToolbarHidden = false
detailViewController.navigationItem.leftBarButtonItem = targetSplit.displayModeButtonItem
detailViewController.navigationItem.leftItemsSupplementBackButton = true
currentArticleIndexPath = indexPath
// rootSplitViewController.toggleMasterView()
targetSplit.showDetailViewController(detailViewController, sender: self)
targetSplit.showDetailViewController(detailNavController, sender: self)
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14845" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14845" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14799.2"/>
@ -7,26 +7,6 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Feeds-->
<scene sceneID="pY4-Hu-kfo">
<objects>
<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">
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="cwK-Lq-cXA">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<autoresizingMask key="autoresizingMask"/>
</toolbar>
<connections>
<segue destination="7bK-jq-Zjz" kind="relationship" relationship="rootViewController" id="Ehy-DL-bQz"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8fS-aE-onr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="154" y="-759"/>
</scene>
<!--Detail-->
<scene sceneID="yUG-lL-AsK">
<objects>
@ -137,11 +117,12 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FJe-Yq-33r" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1043" y="-70"/>
<point key="canvasLocation" x="1619" y="-87"/>
</scene>
<!--System Message-->
<scene sceneID="tbo-yR-QVH">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="rgH-br-nLG" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
<viewController storyboardIdentifier="SystemMessageViewController" title="System Message" id="Xld-e9-xoL" customClass="SystemMessageViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5hz-HK-J2Q">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
@ -167,9 +148,8 @@
<outlet property="messageLabel" destination="6C9-Jb-ZZR" id="HeR-Qv-yfz"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="rgH-br-nLG" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="154" y="-70"/>
<point key="canvasLocation" x="872" y="-87"/>
</scene>
<!--Timeline-->
<scene sceneID="fag-XH-avP">
@ -218,20 +198,6 @@
</objects>
<point key="canvasLocation" x="1620" y="-759"/>
</scene>
<!--Split View Controller-->
<scene sceneID="Nki-YV-4Qg">
<objects>
<splitViewController storyboardIdentifier="SplitViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="H1p-Uh-vWS" sceneMemberID="viewController">
<toolbarItems/>
<connections>
<segue destination="RMx-3f-FxP" kind="relationship" relationship="masterViewController" id="BlO-5A-QYV"/>
<segue destination="Xld-e9-xoL" kind="relationship" relationship="detailViewController" id="oRP-0C-oPK"/>
</connections>
</splitViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cZU-Oi-B1e" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-856" y="-330"/>
</scene>
<!--Feeds-->
<scene sceneID="smW-Zh-WAh">
<objects>

View File

@ -17,9 +17,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
window = UIWindow(windowScene: scene as! UIWindowScene)
window!.tintColor = AppAssets.netNewsWireBlueColor
window?.rootViewController = coordinator.start()
window!.rootViewController = coordinator.start()
window!.makeKeyAndVisible()
// if let userActivity = connectionOptions.userActivities.first ?? session.stateRestorationActivity {
// if !configure(window: window, with: userActivity) {
// print("Failed to restore from \(userActivity)")