Skip to content

Commit

Permalink
Completed task 8 (closes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Vanhoef authored and Peter Vanhoef committed Mar 25, 2017
1 parent 80ac835 commit 57f18fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Calculator/Calculator/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<state key="normal" title="C"/>
<connections>
<action selector="clear:" destination="BYZ-38-t0r" eventType="touchUpInside" id="qr1-Ca-0eX"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cJB-pf-Plh">
<rect key="frame" x="70.5" y="0.0" width="60.5" height="95"/>
Expand Down
6 changes: 6 additions & 0 deletions Calculator/Calculator/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@ class ViewController: UIViewController {
sequence.text = description + (brain.resultIsPending ? ( (description.characters.last != " ") ? "" : "") : " =")
}
}

@IBAction func clear(_ sender: UIButton) {
brain = CalculatorBrain()
displayValue = 0
sequence.text = " "
}
}

0 comments on commit 57f18fe

Please sign in to comment.