diff options
author | Nicholas Tay <nick@windblume.net> | 2022-03-19 13:14:25 +1100 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2022-03-19 13:14:25 +1100 |
commit | 90eb491cb1bee1bd69a5a81cafd6e28d869700fa (patch) | |
tree | 2fc84603b54ca23d6bb9c1778a67f605842b3fd7 | |
parent | f19a09c0e91668a48c1958fc9a4fa07f963c4142 (diff) | |
download | forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.tar.gz forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.tar.bz2 forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.zip |
Remove segue, push directly into nav controller
Diffstat (limited to '')
-rw-r--r-- | foray/Base.lproj/Main.storyboard | 23 | ||||
-rw-r--r-- | foray/ForayTableViewController.swift | 21 |
2 files changed, 7 insertions, 37 deletions
diff --git a/foray/Base.lproj/Main.storyboard b/foray/Base.lproj/Main.storyboard index 6e8fa72..f80ec0b 100644 --- a/foray/Base.lproj/Main.storyboard +++ b/foray/Base.lproj/Main.storyboard @@ -13,19 +13,6 @@ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="60" estimatedRowHeight="-1" sectionHeaderHeight="28" estimatedSectionHeaderHeight="-1" sectionFooterHeight="28" estimatedSectionFooterHeight="-1" id="PLM-PE-uRW"> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <prototypes> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="LNG-Dh-h32"> - <rect key="frame" x="0.0" y="44.5" width="414" height="60"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="LNG-Dh-h32" id="bGl-Iz-uI9"> - <rect key="frame" x="0.0" y="0.0" width="414" height="60"/> - <autoresizingMask key="autoresizingMask"/> - </tableViewCellContentView> - <connections> - <segue destination="8GL-ME-btj" kind="show" identifier="ShowDetailsSegue" id="RNI-y7-uAc"/> - </connections> - </tableViewCell> - </prototypes> <sections/> <connections> <outlet property="dataSource" destination="wzT-eD-ghF" id="VID-cT-ap6"/> @@ -42,16 +29,6 @@ </objects> <point key="canvasLocation" x="447.82608695652175" y="51.5625"/> </scene> - <!--Details--> - <scene sceneID="bHL-Pf-Ers"> - <objects> - <viewController id="8GL-ME-btj" customClass="ForayDetailViewController" customModule="foray" customModuleProvider="target" sceneMemberID="viewController"> - <navigationItem key="navigationItem" title="Details" id="bIX-Sf-Bkw"/> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="MQj-7U-nIV" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="1155.072463768116" y="51.5625"/> - </scene> <!--Foray--> <scene sceneID="Yrg-KY-tVC"> <objects> diff --git a/foray/ForayTableViewController.swift b/foray/ForayTableViewController.swift index 295e055..a16c3bb 100644 --- a/foray/ForayTableViewController.swift +++ b/foray/ForayTableViewController.swift @@ -158,21 +158,14 @@ class ForayTableViewController: UITableViewController { return "Released in " + dateFormatter.string(from: section.year) } + let detailViewController: ForayDetailViewController = ForayDetailViewController() + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) - performSegue(withIdentifier: "ShowDetailsSegue", sender: indexPath) - } - - // MARK: - Navigation - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "ShowDetailsSegue" { - let indexPath = sender as! IndexPath - let item = self.sections[indexPath.section].items[indexPath.row] - let dvc = segue.destination as! ForayDetailViewController - dvc.selectedItem = item - } else { - fatalError("unreachable") - } + + let item = self.sections[indexPath.section].items[indexPath.row] + detailViewController.selectedItem = item + + self.navigationController?.pushViewController(detailViewController, animated: true) } } |