顯示過程算式和結果

This commit is contained in:
2020-05-05 00:49:00 +08:00
parent 15e7285a3c
commit c9445dd5e7
2 changed files with 20 additions and 0 deletions

View File

@@ -197,6 +197,22 @@
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hLf-ut-UVB"> <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hLf-ut-UVB">
<rect key="frame" x="0.0" y="0.0" width="375" height="204"/> <rect key="frame" x="0.0" y="0.0" width="375" height="204"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="7" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HLr-pN-Kn5">
<rect key="frame" x="25" y="132" width="324" height="39"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="32"/>
<color key="textColor" systemColor="systemGrayColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="1+2×3" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hBk-3O-ze9">
<rect key="frame" x="25" y="73" width="324" height="51"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="42"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view> </view>
</subviews> </subviews>
@@ -205,6 +221,8 @@
</view> </view>
<connections> <connections>
<outlet property="borderView" destination="srp-dc-mcA" id="ETm-Yj-q7C"/> <outlet property="borderView" destination="srp-dc-mcA" id="ETm-Yj-q7C"/>
<outlet property="formulaLabel" destination="hBk-3O-ze9" id="dZb-Wh-Z9j"/>
<outlet property="resultLabel" destination="HLr-pN-Kn5" id="xna-3f-s3J"/>
<outletCollection property="numberButtons" destination="iKJ-gm-pgJ" collectionClass="NSMutableArray" id="pku-qD-GzX"/> <outletCollection property="numberButtons" destination="iKJ-gm-pgJ" collectionClass="NSMutableArray" id="pku-qD-GzX"/>
<outletCollection property="numberButtons" destination="nAR-KS-hdA" collectionClass="NSMutableArray" id="BPw-Wl-WA0"/> <outletCollection property="numberButtons" destination="nAR-KS-hdA" collectionClass="NSMutableArray" id="BPw-Wl-WA0"/>
<outletCollection property="numberButtons" destination="kDf-qC-jcV" collectionClass="NSMutableArray" id="DW5-pD-IzB"/> <outletCollection property="numberButtons" destination="kDf-qC-jcV" collectionClass="NSMutableArray" id="DW5-pD-IzB"/>

View File

@@ -11,6 +11,8 @@ import UIKit
class ViewController: UIViewController { class ViewController: UIViewController {
@IBOutlet weak var borderView: UIView! @IBOutlet weak var borderView: UIView!
@IBOutlet weak var formulaLabel: UILabel!
@IBOutlet weak var resultLabel: UILabel!
@IBOutlet var numberButtons: [UIButton]! @IBOutlet var numberButtons: [UIButton]!
@IBAction func clickNumberButton(_ sender: UIButton) { @IBAction func clickNumberButton(_ sender: UIButton) {