aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--foray/Base.lproj/Main.storyboard23
-rw-r--r--foray/ForayTableViewController.swift21
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)
}
}