Commit 3cff40f2 authored by Philip Brechler's avatar Philip Brechler

Move from "didSelect" to Segues, because that's cool now

parent 242094ae
......@@ -96,16 +96,16 @@
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="JET-70-HyJ">
<rect key="frame" x="33.5" y="194" width="347.5" height="353.5"/>
<rect key="frame" x="31.5" y="194" width="351.5" height="353.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Light Sensor: 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lJg-Re-XS3">
<rect key="frame" x="0.0" y="0.0" width="347.5" height="20.5"/>
<rect key="frame" x="0.0" y="0.0" width="351.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5A8-DY-c38">
<rect key="frame" x="0.0" y="32.5" width="347.5" height="30"/>
<rect key="frame" x="0.0" y="32.5" width="351.5" height="30"/>
<state key="normal" title="Get Light Sensor">
<color key="titleColor" name="tintColor"/>
</state>
......@@ -114,7 +114,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QYZ-If-ozK">
<rect key="frame" x="0.0" y="74.5" width="347.5" height="30"/>
<rect key="frame" x="0.0" y="74.5" width="351.5" height="30"/>
<state key="normal" title="Set Time">
<color key="titleColor" name="tintColor"/>
</state>
......@@ -123,7 +123,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UFI-0G-kFH">
<rect key="frame" x="0.0" y="116.5" width="347.5" height="30"/>
<rect key="frame" x="0.0" y="116.5" width="351.5" height="30"/>
<state key="normal" title="Upload File">
<color key="titleColor" name="tintColor"/>
</state>
......@@ -132,16 +132,16 @@
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="1D6-jV-aH3">
<rect key="frame" x="0.0" y="158.5" width="347.5" height="29"/>
<rect key="frame" x="0.0" y="158.5" width="351.5" height="29"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rocket 1: 0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cB5-3u-vrD">
<rect key="frame" x="0.0" y="0.0" width="245.5" height="29"/>
<rect key="frame" x="0.0" y="0.0" width="249.5" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="255" stepValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="H5L-LZ-EHZ">
<rect key="frame" x="253.5" y="0.0" width="94" height="29"/>
<rect key="frame" x="257.5" y="0.0" width="94" height="29"/>
<color key="tintColor" name="tintColor"/>
<connections>
<action selector="rocketStepperChangedWithSender:" destination="e67-Bh-g0f" eventType="valueChanged" id="xSL-K5-gcd"/>
......@@ -151,16 +151,16 @@
<viewLayoutGuide key="safeArea" id="Ygw-J2-6aA"/>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="znU-kU-yoJ">
<rect key="frame" x="0.0" y="199.5" width="347.5" height="29"/>
<rect key="frame" x="0.0" y="199.5" width="351.5" height="29"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rocket 2: 0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mn7-Gg-Hsi">
<rect key="frame" x="0.0" y="0.0" width="245.5" height="29"/>
<rect key="frame" x="0.0" y="0.0" width="249.5" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="255" stepValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="KQi-nU-1q5">
<rect key="frame" x="253.5" y="0.0" width="94" height="29"/>
<rect key="frame" x="257.5" y="0.0" width="94" height="29"/>
<color key="tintColor" name="tintColor"/>
<connections>
<action selector="rocketStepperChangedWithSender:" destination="e67-Bh-g0f" eventType="valueChanged" id="Wie-F3-wZY"/>
......@@ -169,16 +169,16 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="sr7-gT-G1y">
<rect key="frame" x="0.0" y="240.5" width="347.5" height="29"/>
<rect key="frame" x="0.0" y="240.5" width="351.5" height="29"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rocket 3: 0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fnh-o6-x1V">
<rect key="frame" x="0.0" y="0.0" width="245.5" height="29"/>
<rect key="frame" x="0.0" y="0.0" width="249.5" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="255" stepValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="I6D-iL-6DL">
<rect key="frame" x="253.5" y="0.0" width="94" height="29"/>
<rect key="frame" x="257.5" y="0.0" width="94" height="29"/>
<color key="tintColor" name="tintColor"/>
<connections>
<action selector="rocketStepperChangedWithSender:" destination="e67-Bh-g0f" eventType="valueChanged" id="14Q-8R-UqI"/>
......@@ -188,7 +188,7 @@
<viewLayoutGuide key="safeArea" id="9RV-tW-uRj"/>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fgN-8S-U4R">
<rect key="frame" x="0.0" y="281.5" width="347.5" height="30"/>
<rect key="frame" x="0.0" y="281.5" width="351.5" height="30"/>
<state key="normal" title="Vibrate: 100ms">
<color key="titleColor" name="tintColor"/>
</state>
......@@ -197,7 +197,7 @@
</connections>
</button>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="100" minValue="1" maxValue="1000" translatesAutoresizingMaskIntoConstraints="NO" id="rkJ-6S-YNK">
<rect key="frame" x="-2" y="323.5" width="351.5" height="31"/>
<rect key="frame" x="-2" y="323.5" width="355.5" height="31"/>
<color key="tintColor" name="tintColor"/>
<connections>
<action selector="lightSliderChangedWithSender:" destination="e67-Bh-g0f" eventType="valueChanged" id="Do9-TK-28B"/>
......@@ -269,6 +269,9 @@
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="sXY-Ku-xcS" kind="show" identifier="HatcheryEggDetailSegue" id="kSN-32-ALc"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
......
......@@ -77,19 +77,18 @@ class HatcheryRootTableViewController: UITableViewController,HatcheryClientDeleg
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let indexPath = self.tableView.indexPathForSelectedRow!
let eggForCell:HatcheryEgg
if (isFiltering()) {
eggForCell = self.filteredEggs[indexPath.row]
} else {
eggForCell = (self.client?.loadedEggs[indexPath.row])!
}
let eggViewController = self.storyboard?.instantiateViewController(withIdentifier: "HatcheryDetailViewController") as? HatcheryDetailViewController
eggViewController?.eggToShow = eggForCell
self.navigationController?.pushViewController(eggViewController!, animated: true)
let eggDetailViewController = segue.destination as? HatcheryDetailViewController
eggDetailViewController?.eggToShow = eggForCell
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment