Skip to content

Commit

Permalink
chore: 커밋 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenkim18 committed Mar 9, 2021
1 parent e97c7ec commit 48267db
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
18 changes: 13 additions & 5 deletions JuiceMaker/JuiceMaker/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="landscape" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.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" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="JuiceMaker" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="667" height="375"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-306" y="191"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
21 changes: 10 additions & 11 deletions JuiceMaker/JuiceMaker/JuiceMaker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,30 @@ class JuiceMaker {
}
return true
}
func consumeFriut(fruit: Fruit, stock: Int) {
func consumeFruit(fruit: Fruit, stock: Int) {
fruitStocks[fruit.index] -= stock
}
func makeFruitJuice(juice: FruitJuice) {
switch juice {
case .strawberry:
consumeFriut(fruit: .strawberry, stock: 16)
consumeFruit(fruit: .strawberry, stock: 16)
case .banana:
consumeFriut(fruit: .banana, stock: 2)
consumeFruit(fruit: .banana, stock: 2)
case .kiwi:
consumeFriut(fruit: .kiwi, stock: 3)
consumeFruit(fruit: .kiwi, stock: 3)
case .pineapple:
consumeFriut(fruit: .pineapple, stock: 2)
consumeFruit(fruit: .pineapple, stock: 2)
case .strawberryBanana:
consumeFriut(fruit: .strawberry, stock: 10)
consumeFriut(fruit: .banana, stock: 1)
consumeFruit(fruit: .strawberry, stock: 10)
consumeFruit(fruit: .banana, stock: 1)
case .mango:
consumeFriut(fruit: .mango, stock: 3)
consumeFruit(fruit: .mango, stock: 3)
case .mangoKiwi:
consumeFriut(fruit: .mango, stock: 2)
consumeFriut(fruit: .kiwi, stock: 1)
consumeFruit(fruit: .mango, stock: 2)
consumeFruit(fruit: .kiwi, stock: 1)
}
}
func addStock(fruit: Fruit) {
fruitStocks[fruit.index] += 1
}
}

7 changes: 3 additions & 4 deletions JuiceMaker/JuiceMaker/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ class ViewController: UIViewController {
// Do any additional setup after loading the view.

let j = JuiceMaker()
print(j.fruitStocks)
print(j.checkStock(fruit: .strawberry))
j.addStock(fruit: .strawberry)
print(j.checkStock(fruit: .strawberry))

j.consumeFriut(fruit: .banana, stock: 12)

print(j.fruitStocks)

}
}
Expand Down

0 comments on commit 48267db

Please sign in to comment.