Skip to content

Commit

Permalink
added timer label
Browse files Browse the repository at this point in the history
  • Loading branch information
keoki33 committed Feb 23, 2020
1 parent d76dbf3 commit 6e2d812
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Binary file not shown.
12 changes: 12 additions & 0 deletions EggTimer/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nJN-th-c5K" userLabel="Timer View">
<rect key="frame" x="0.0" y="571.5" width="374" height="246.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kgY-tu-Osy">
<rect key="frame" x="145" y="92" width="84" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
</subviews>
</stackView>
Expand All @@ -133,6 +142,9 @@
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="counterDisplay" destination="kgY-tu-Osy" id="4ts-W0-QLA"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
2 changes: 2 additions & 0 deletions EggTimer/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ViewController: UIViewController {
var counter: Int = 0


@IBOutlet weak var counterDisplay: UILabel!

@IBAction func hardnessSelected(_ sender: UIButton) {
let hardness = sender.currentTitle!
Expand Down Expand Up @@ -45,6 +46,7 @@ print("none") }
@objc func timer() {
if counter > -1 {
print(counter)
counterDisplay.text = String(counter)
counter -= 1}
else {
gameTimer?.invalidate()
Expand Down

0 comments on commit 6e2d812

Please sign in to comment.