Question

IOS Swift Code

3) You are creating a calculator app and you are using the MVC architecture discussed in class. You ate a view, a view contro

0 0
Add a comment Improve this question Transcribed image text
Answer #1
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var display: UILabel!
var userIsInTheMiddleOfTyping = false
@IBAction func touchDigit(_ sender: UIButton) {
let digit = sender.currentTitle!
let textCurrentlyInDisplay = display.text!
if userIsInTheMiddleOfTyping {
display.text = textCurrentlyInDisplay + digit
} else {
display.text = digit
userIsInTheMiddleOfTyping = true
}
}
var displayValue: Double {
get {
return Double(display.text!)!
}
set {
display.text = String(newValue)
}
}
private var brain = CalculatorBrain()
@IBAction func performOperation(_ sender: UIButton) {
if userIsInTheMiddleOfTyping {
brain.setOperand(displayValue)
userIsInTheMiddleOfTyping = false
}
if let mathematicalSymbol = sender.currentTitle {
brain.performOperation(mathematicalSymbol)
}
if let result = brain.result {
displayValue = result
}
}
}
import Foundation
struct CalculatorBrain {
/* think about public API when creating models */
private var accumulator: Double?
private enum Operation {
case constant(Double)
case unaryOperation((Double)->Double)
case binaryOperation((Double, Double) -> Double)
case equals
}
private var operations: Dictionary<String, Operation> = [
"π": Operation.constant(Double.pi),
"e": Operation.constant(M_E),
"√": Operation.unaryOperation(sqrt),
"cos": Operation.unaryOperation(cos),
"±": Operation.unaryOperation{-$0},
"×": Operation.binaryOperation{$0 * $1},
"÷": Operation.binaryOperation{$0 / $1},
"−": Operation.binaryOperation{$0 - $1},
"+": Operation.binaryOperation{$0 + $1},
"=": Operation.equals
]
mutating func performOperation(_ symbol: String) {
if let operation = operations[symbol] {
switch operation {
case .constant(let value):
accumulator = value
case .unaryOperation(let function):
if accumulator != nil {
accumulator = function(accumulator!)
}
case .binaryOperation(let function):
if accumulator != nil {
pendingBinaryOperation = PendingBinaryOperation(function: function, firstOperand: accumulator!)
accumulator = nil
}
case .equals:
performPendingBinaryOperation()
}
}
}
private mutating func performPendingBinaryOperation() {
if pendingBinaryOperation != nil && accumulator != nil {
accumulator = pendingBinaryOperation!.perform(with: accumulator!)
pendingBinaryOperation = nil
}
}
private var pendingBinaryOperation: PendingBinaryOperation?
private struct PendingBinaryOperation {
let function: (Double, Double) -> Double
let firstOperand: Double
func perform(with secondOperand: Double) -> Double {
return function(firstOperand, secondOperand)
}
}
mutating func setOperand(_ operand: Double) {
accumulator = operand
}
/* read only property: computed property */
var result: Double? {
get {
return accumulator
}
}
}

{

"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <scenes>
        <!--View Controller-->
        <scene sceneID="EHf-IW-A2E">
            <objects>
                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
                    <layoutGuides>
                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
                    </layoutGuides>
                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                    </view>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="53" y="375"/>
        </scene>
    </scenes>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina3_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Calculator" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ejB-0M-qL0">
<rect key="frame" x="16" y="20" width="288" height="460"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="hHl-jG-xuj">
<rect key="frame" x="0.0" y="0.0" width="288" height="48"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="40"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="omr-Vb-2gD">
<rect key="frame" x="0.0" y="58" width="288" height="402"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="7mi-Zt-hHj">
<rect key="frame" x="0.0" y="0.0" width="288" height="72.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hkk-RF-cW3">
<rect key="frame" x="0.0" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="+"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="R9G-lc-dfJ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PD9-PJ-EAq">
<rect key="frame" x="74.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="−"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="N0y-zN-3UH"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pMa-cH-paS">
<rect key="frame" x="149" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="÷"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="TcJ-sN-mAa"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jPb-wY-4e6">
<rect key="frame" x="223.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="×"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="0fP-K9-skl"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="xJC-53-7zN">
<rect key="frame" x="0.0" y="82.5" width="288" height="72.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yw1-hH-yof">
<rect key="frame" x="0.0" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="π"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="osg-5g-YtB"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="O0b-5C-gVh">
<rect key="frame" x="74.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="7"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="GwI-ic-A3K"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Of2-RQ-Mmu">
<rect key="frame" x="149" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="8"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="K8f-5G-OVO"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="R9a-sD-Lol">
<rect key="frame" x="223.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="9"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="zax-BP-GFG"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="2Za-tk-ibv">
<rect key="frame" x="0.0" y="165" width="288" height="72"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Vdq-LL-5oO">
<rect key="frame" x="0.0" y="0.0" width="64.5" height="72"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="√"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="nMw-gw-nrb"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mXb-Lm-bfI">
<rect key="frame" x="74.5" y="0.0" width="64.5" height="72"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="4"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="nn2-3c-5UD"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FxL-Kd-GV8">
<rect key="frame" x="149" y="0.0" width="64.5" height="72"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="5"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="b9v-le-vsb"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rq5-Bp-Qku">
<rect key="frame" x="223.5" y="0.0" width="64.5" height="72"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="6"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="M1s-jw-qIj"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="tzH-Jh-dKf">
<rect key="frame" x="0.0" y="247" width="288" height="72.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="25j-97-aAq">
<rect key="frame" x="0.0" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="cos"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="mde-fu-uVf"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uGl-ie-kIi">
<rect key="frame" x="74.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="1"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="aaG-BZ-h9A"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W57-Dc-042">
<rect key="frame" x="149" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="2"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="btE-Is-h48"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JTY-ua-kEq">
<rect key="frame" x="223.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="3"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="QZS-V0-fbZ"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ABN-G3-GfG">
<rect key="frame" x="0.0" y="329.5" width="288" height="72.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yEO-av-4B0">
<rect key="frame" x="0.0" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="±"/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="zaF-SA-yhb"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fio-8Y-YcZ">
<rect key="frame" x="74.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="."/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="TnN-XK-Nom"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NWz-SE-WnW">
<rect key="frame" x="149" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="0"/>
<connections>
<action selector="touchDigit:" destination="BYZ-38-t0r" eventType="touchUpInside" id="5mp-vT-jk8"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f3w-R5-HPQ">
<rect key="frame" x="223.5" y="0.0" width="64.5" height="72.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="="/>
<connections>
<action selector="performOperation:" destination="BYZ-38-t0r" eventType="touchUpInside" id="AQI-t7-6UT"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="ejB-0M-qL0" secondAttribute="bottom" id="14O-ga-P5Y"/>
<constraint firstItem="ejB-0M-qL0" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="9s3-GW-Jlm"/>
<constraint firstAttribute="leadingMargin" secondItem="ejB-0M-qL0" secondAttribute="leading" id="IQY-SJ-217"/>
<constraint firstAttribute="trailingMargin" secondItem="ejB-0M-qL0" secondAttribute="trailing" id="Za5-m5-8Jc"/>
</constraints>
</view>
<connections>
<outlet property="display" destination="hHl-jG-xuj" id="5R3-7y-5wN"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="117.59999999999999" y="122.78860569715144"/>
</scene>
</scenes>
</document>
Add a comment
Know the answer?
Add Answer to:
3) You are creating a calculator app and you are using the MVC architecture discussed in class. Y...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Original Source Material Student Version First, the potential of digital games is discussed using the tutor/tool/tutee...

    Original Source Material Student Version First, the potential of digital games is discussed using the tutor/tool/tutee framework proposed by Taylor (1980). Second, the potential of digital games to enhance learning by connecting game worlds and real worlds is stated. Third, the possibility of digital games to facilitate collaborative problem-solving is addressed. Fourth, the capability of digital games to provide an affective environment for science learning is suggested. Last, the potential of using digital games to promote science learning for younger...

  • Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of...

    Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of physician-centered and collaborative communication. How is the caregiver’s role different in each model? How is the patient’s role different? Answer: Physical-centered communication involves the specialists taking control of the conversation. They decide on the topics of discussion and when to end the process. The patient responds to the issues raised by the caregiver and acts accordingly. On the other hand, Collaborative communication involves a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT