-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from leeari95/4-leeari95
쥬스메이커 [STEP 2] 제이티, Ari
- Loading branch information
Showing
10 changed files
with
386 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Text.swift | ||
// JuiceMaker | ||
// | ||
// Created by 김진태 on 2021/10/28. | ||
// | ||
|
||
import Foundation | ||
|
||
enum Message: CustomStringConvertible { | ||
case juiceFinish(juice: Juice) | ||
case unknownError | ||
case outOfStock | ||
|
||
var description: String { | ||
switch self { | ||
case .juiceFinish(let juice): | ||
return "\(juice.name) 쥬스 나왔습니다! 맛있게 드세요!" | ||
case .unknownError: | ||
return "알 수 없는 에러가 발생했습니다." | ||
case .outOfStock: | ||
return "재료가 모자라요. 재고를 수정할까요?" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Text.swift | ||
// JuiceMaker | ||
// | ||
// Created by 김진태 on 2021/10/28. | ||
// | ||
|
||
import UIKit.UIButton | ||
|
||
enum Text { | ||
case cancel | ||
case ok | ||
|
||
var title: String { | ||
return localizedTitle(key: self.key) | ||
} | ||
|
||
private var key: String { | ||
switch self { | ||
case .cancel: | ||
return "Cancel" | ||
case .ok: | ||
return "OK" | ||
} | ||
} | ||
|
||
private func localizedTitle(key: String) -> String { | ||
let bundle = Bundle.init(for: UIButton.self) | ||
let title = bundle.localizedString(forKey: key, value: nil, table: nil) | ||
return title | ||
} | ||
} |
Oops, something went wrong.