RPS WVM Completed

This commit is contained in:
Aaron
2021-01-24 15:40:27 -05:00
parent 7471f71212
commit 54eabb62d2
2 changed files with 49 additions and 43 deletions
@@ -96,6 +96,7 @@ class AlarmActivationViewController: UIViewController
rpsResult.text = "Paper: You lost, try again" rpsResult.text = "Paper: You lost, try again"
} }
} }
@IBAction func paperChoice(_ sender: Any) { @IBAction func paperChoice(_ sender: Any) {
if rpsAction(choice: .paper)! { if rpsAction(choice: .paper)! {
endAlarm() endAlarm()
+48 -43
View File
@@ -653,52 +653,53 @@
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemGray6Color"/> <color key="backgroundColor" systemColor="systemGray6Color"/>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Smash your phone to dismiss" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mjE-Hr-RIc">
<rect key="frame" x="95.5" y="411" width="223.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NmX-iJ-1D0" userLabel="rpsView"> <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NmX-iJ-1D0" userLabel="rpsView">
<rect key="frame" x="20" y="261" width="374" height="343"/> <rect key="frame" x="20" y="261" width="374" height="343"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" fixedFrame="YES" spacing="64" translatesAutoresizingMaskIntoConstraints="NO" id="213-rS-oYj"> <stackView opaque="NO" contentMode="scaleToFill" fixedFrame="YES" axis="vertical" spacing="114" translatesAutoresizingMaskIntoConstraints="NO" id="NTs-bN-aK1">
<rect key="frame" x="19" y="134" width="336" height="42"/> <rect key="frame" x="19" y="0.0" width="336" height="188.5"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ndj-R4-AKk"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RPS: What do you choose?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HEP-oh-VSY">
<rect key="frame" x="0.0" y="0.0" width="55" height="42"/> <rect key="frame" x="0.0" y="0.0" width="336" height="32.5"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/> <fontDescription key="fontDescription" type="system" pointSize="27"/>
<state key="normal" title="Rock"/> <nil key="textColor"/>
<connections> <nil key="highlightedColor"/>
<action selector="rockChoice:" destination="hDW-11-g9U" eventType="touchUpInside" id="w4O-MC-ohr"/> </label>
</connections> <stackView opaque="NO" contentMode="scaleToFill" spacing="64" translatesAutoresizingMaskIntoConstraints="NO" id="213-rS-oYj">
</button> <rect key="frame" x="0.0" y="146.5" width="336" height="42"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iiv-Co-j8G"> <subviews>
<rect key="frame" x="119" y="0.0" width="62" height="42"/> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ndj-R4-AKk">
<fontDescription key="fontDescription" type="system" pointSize="25"/> <rect key="frame" x="0.0" y="0.0" width="55" height="42"/>
<state key="normal" title="Paper"/> <color key="backgroundColor" systemColor="systemGroupedBackgroundColor"/>
<connections> <fontDescription key="fontDescription" type="system" pointSize="25"/>
<action selector="paperChoice:" destination="hDW-11-g9U" eventType="touchUpInside" id="giR-wy-jqv"/> <state key="normal" title="Rock"/>
</connections> <connections>
</button> <action selector="rockChoice:" destination="hDW-11-g9U" eventType="touchUpInside" id="w4O-MC-ohr"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U4y-ls-yuK"> </connections>
<rect key="frame" x="245" y="0.0" width="91" height="42"/> </button>
<fontDescription key="fontDescription" type="system" pointSize="25"/> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iiv-Co-j8G">
<state key="normal" title="Scissors"/> <rect key="frame" x="119" y="0.0" width="62" height="42"/>
<connections> <color key="backgroundColor" systemColor="secondarySystemBackgroundColor"/>
<action selector="scissorChoice:" destination="hDW-11-g9U" eventType="touchUpInside" id="BVu-ST-Hfr"/> <fontDescription key="fontDescription" type="system" pointSize="25"/>
</connections> <state key="normal" title="Paper"/>
</button> <connections>
<action selector="paperChoice:" destination="hDW-11-g9U" eventType="touchUpInside" id="giR-wy-jqv"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U4y-ls-yuK">
<rect key="frame" x="245" y="0.0" width="91" height="42"/>
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/>
<state key="normal" title="Scissors"/>
<connections>
<action selector="scissorChoice:" destination="hDW-11-g9U" eventType="touchUpInside" id="BVu-ST-Hfr"/>
</connections>
</button>
</subviews>
</stackView>
</subviews> </subviews>
</stackView> </stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="RPS: What do you choose?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HEP-oh-VSY">
<rect key="frame" x="31" y="8" width="313" height="33"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="27"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemGray4Color"/> <color key="backgroundColor" systemColor="systemGray4Color"/>
</view> </view>
@@ -711,8 +712,6 @@
<constraint firstItem="42Q-0v-ZS3" firstAttribute="top" secondItem="vmg-Oj-8tB" secondAttribute="bottom" constant="-5" id="GNM-uI-sQt"/> <constraint firstItem="42Q-0v-ZS3" firstAttribute="top" secondItem="vmg-Oj-8tB" secondAttribute="bottom" constant="-5" id="GNM-uI-sQt"/>
<constraint firstItem="hS6-fS-yWp" firstAttribute="trailing" secondItem="42Q-0v-ZS3" secondAttribute="trailing" constant="20" id="L1F-Bv-r5M"/> <constraint firstItem="hS6-fS-yWp" firstAttribute="trailing" secondItem="42Q-0v-ZS3" secondAttribute="trailing" constant="20" id="L1F-Bv-r5M"/>
<constraint firstItem="42Q-0v-ZS3" firstAttribute="leading" secondItem="hS6-fS-yWp" secondAttribute="leading" constant="20" id="Nbf-jB-Uq5"/> <constraint firstItem="42Q-0v-ZS3" firstAttribute="leading" secondItem="hS6-fS-yWp" secondAttribute="leading" constant="20" id="Nbf-jB-Uq5"/>
<constraint firstItem="mjE-Hr-RIc" firstAttribute="centerY" secondItem="BZn-UX-vps" secondAttribute="centerY" id="SFw-9a-XAc"/>
<constraint firstItem="mjE-Hr-RIc" firstAttribute="centerX" secondItem="BZn-UX-vps" secondAttribute="centerX" id="oBA-RV-cEO"/>
<constraint firstItem="hS6-fS-yWp" firstAttribute="trailing" secondItem="vmg-Oj-8tB" secondAttribute="trailing" constant="20" id="vVE-ID-dgj"/> <constraint firstItem="hS6-fS-yWp" firstAttribute="trailing" secondItem="vmg-Oj-8tB" secondAttribute="trailing" constant="20" id="vVE-ID-dgj"/>
</constraints> </constraints>
</view> </view>
@@ -726,7 +725,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="78q-sr-CNz" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="78q-sr-CNz" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="2391" y="1102"/> <point key="canvasLocation" x="2389.8550724637685" y="1101.5625"/>
</scene> </scene>
<!--Alarm Activator--> <!--Alarm Activator-->
<scene sceneID="c7a-VN-D68"> <scene sceneID="c7a-VN-D68">
@@ -853,7 +852,7 @@
<rect key="frame" x="0.0" y="0.0" width="374" height="170"/> <rect key="frame" x="0.0" y="0.0" width="374" height="170"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="person.crop.circle.badge.checkmark" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="yVW-fL-SIQ"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="person.crop.circle.badge.checkmark" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="yVW-fL-SIQ">
<rect key="frame" x="130.5" y="0.0" width="111.5" height="109.5"/> <rect key="frame" x="132" y="0.0" width="110" height="109.5"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="110" id="So8-k5-nLS"/> <constraint firstAttribute="width" constant="110" id="So8-k5-nLS"/>
<constraint firstAttribute="height" constant="110" id="inA-vb-CrL"/> <constraint firstAttribute="height" constant="110" id="inA-vb-CrL"/>
@@ -938,6 +937,9 @@
<systemColor name="secondaryLabelColor"> <systemColor name="secondaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>
<systemColor name="secondarySystemBackgroundColor">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor"> <systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor> </systemColor>
@@ -947,6 +949,9 @@
<systemColor name="systemGray6Color"> <systemColor name="systemGray6Color">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>
<systemColor name="systemGroupedBackgroundColor">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemOrangeColor"> <systemColor name="systemOrangeColor">
<color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>