Skip to content

Commit bf6246a

Browse files
authored
Merge pull request #117 from TeamNobar/bug/#116-tasting-note
[BUG] ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ ๋ฒ„๊ทธ ์ˆ˜์ •
2 parents ea19a53 + 29b7929 commit bf6246a

7 files changed

Lines changed: 50 additions & 26 deletions

File tree

โ€ŽNobar.xcodeproj/project.pbxprojโ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@
750750
6AD777C9288A9AD500424585 /* Component */,
751751
6AD777C8288A9ACF00424585 /* Model */,
752752
3CD4370C2877DC910044AE04 /* WritingNote.storyboard */,
753+
6AD777CC288A9B1A00424585 /* CocktailNameSearchViewController.swift */,
753754
3CD437122877EC530044AE04 /* WritingNoteViewController.swift */,
754755
);
755756
path = WritingNote;
@@ -948,7 +949,6 @@
948949
isa = PBXGroup;
949950
children = (
950951
6AD777CA288A9AF200424585 /* Status.swift */,
951-
6AD777CC288A9B1A00424585 /* CocktailNameSearchViewController.swift */,
952952
);
953953
path = Model;
954954
sourceTree = "<group>";
@@ -1734,7 +1734,7 @@
17341734
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
17351735
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
17361736
CODE_SIGN_ENTITLEMENTS = Nobar/Nobar.entitlements;
1737-
CODE_SIGN_IDENTITY = "iPhone Distribution";
1737+
CODE_SIGN_IDENTITY = "iPhone Developer";
17381738
CODE_SIGN_STYLE = Manual;
17391739
CURRENT_PROJECT_VERSION = 1;
17401740
DEVELOPMENT_TEAM = BWM6S332K8;
@@ -1753,7 +1753,7 @@
17531753
MARKETING_VERSION = 1.0;
17541754
PRODUCT_BUNDLE_IDENTIFIER = "kr.teamnobar.nobar-ios-release";
17551755
PRODUCT_NAME = "$(TARGET_NAME)";
1756-
PROVISIONING_PROFILE_SPECIFIER = "match AppStore kr.teamnobar.nobar-ios-release";
1756+
PROVISIONING_PROFILE_SPECIFIER = "match Development kr.teamnobar.nobar-ios-release";
17571757
SWIFT_EMIT_LOC_STRINGS = YES;
17581758
SWIFT_VERSION = 5.0;
17591759
TARGETED_DEVICE_FAMILY = 1;

โ€ŽNobar.xcodeproj/xcshareddata/xcschemes/Nobar.xcschemeโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</Testables>
5252
</TestAction>
5353
<LaunchAction
54-
buildConfiguration = "Debug"
54+
buildConfiguration = "Release"
5555
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5656
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
5757
launchStyle = "0"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>

โ€ŽNobar/Scenes/WritingNote/Cell/TasteCVC.swiftโ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,23 @@ extension TasteCVC {
7777

7878
func bind(with tags: [Tag]) {
7979
self.tags = tags
80+
topStackView.removeAllSubViews()
81+
middleStackView.removeAllSubViews()
82+
bottomStackView.removeAllSubViews()
8083

8184
guard tags.count == 9 else { return }
8285

8386
for i in 0..<9 {
8487
let tagView = TastingTagView()
8588
tagView.setTastingTagView(with: tags[i])
8689
tagView.tag = i+1
87-
tagViews += [tagView]
8890
switch i {
8991
case 0..<3: topStackView.addArrangedSubview(tagView)
9092
case 3..<6: middleStackView.addArrangedSubview(tagView)
9193
case 6..<9: bottomStackView.addArrangedSubview(tagView)
9294
default: return
9395
}
96+
9497
}
9598

9699
setNeedsLayout()

โ€ŽNobar/Scenes/WritingNote/Cell/TastingNoteHeaderView.swiftโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extension TastingNoteHeaderView {
6666
switch status{
6767
case .newWriting,.revising:
6868
titleLabel.text = "์–ธ์ œ ์นตํ…Œ์ผ์„ ๋งˆ์…จ๋‚˜์š”?"
69+
notiLabel.text = ""
6970
case .viewing:
7071
titleLabel.text = "์นตํ…Œ์ผ์„ ๋งŒ๋“  ๋‚ ์งœ"
7172
}
File renamed without changes.

โ€ŽNobar/Scenes/WritingNote/WritingNoteViewController.swiftโ€Ž

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ final class WritingNoteViewController: BaseViewController {
6868
private let deleteButton = UIButton().then {
6969
$0.setImage(ImageFactory.icnDelete, for: .normal)
7070
}
71-
private let reviseButton = UIButton().then {
71+
private lazy var reviseButton = UIButton().then {
7272
$0.setImage(ImageFactory.icnModify, for: .normal)
73+
$0.addTarget(self, action: #selector(didTapReviseButton(_:)), for: .touchUpInside)
7374
}
7475

7576
private let grayLine = UIView().then {
@@ -100,7 +101,8 @@ extension WritingNoteViewController {
100101
render()
101102
setDelegation()
102103
setRegistration()
103-
setTitleViewLayout()
104+
initHeaderBarLayout()
105+
setHeaderBarLayout()
104106
setNotification()
105107
fetchTastingNoteTags()
106108
}
@@ -112,7 +114,7 @@ extension WritingNoteViewController {
112114
private func render() {
113115
view.addSubviews([headerBarView,grayLine,tastingCollectionView])
114116
}
115-
private func setTitleViewLayout() {
117+
private func initHeaderBarLayout() {
116118
headerBarView.addSubviews([closeButton,titleLabel,applyButton,reviseButton,deleteButton])
117119

118120
closeButton.snp.makeConstraints{
@@ -139,23 +141,7 @@ extension WritingNoteViewController {
139141
}
140142

141143

142-
switch writingstatus{
143-
case .newWriting:
144-
titleLabel.text = "ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ ๊ธฐ๋กํ•˜๊ธฐ"
145-
applyButton.isHidden = false
146-
reviseButton.isHidden = true
147-
deleteButton.isHidden = true
148-
case .revising:
149-
titleLabel.text = "ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ ์ˆ˜์ •ํ•˜๊ธฐ"
150-
applyButton.isHidden = false
151-
reviseButton.isHidden = true
152-
deleteButton.isHidden = true
153-
case .viewing:
154-
titleLabel.text = "์ž‘์„ฑํ•œ ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ"
155-
applyButton.isHidden = true
156-
reviseButton.isHidden = false
157-
deleteButton.isHidden = false
158-
}
144+
159145
}
160146

161147
private func setLayout() {
@@ -238,7 +224,6 @@ extension WritingNoteViewController {
238224
if let keyboardFrame: NSValue = noti.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
239225
if self.view.frame.origin.y != 0 {
240226

241-
/// naviBar ๋งŒํผ ๋‚ด๋ฆผ
242227
self.view.frame.origin.y += keyboardFrame.cgRectValue.size.height
243228
}
244229
}
@@ -272,6 +257,32 @@ extension WritingNoteViewController {
272257
print("closetapped")
273258
self.dismiss(animated: true)
274259
}
260+
@objc private func didTapReviseButton(_ sender: UIButton){
261+
print("revisetapped")
262+
writingstatus = .revising
263+
setHeaderBarLayout()
264+
tastingCollectionView.reloadData()
265+
266+
}
267+
private func setHeaderBarLayout(){
268+
switch writingstatus{
269+
case .newWriting:
270+
titleLabel.text = "ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ ๊ธฐ๋กํ•˜๊ธฐ"
271+
applyButton.isHidden = false
272+
reviseButton.isHidden = true
273+
deleteButton.isHidden = true
274+
case .revising:
275+
titleLabel.text = "ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ ์ˆ˜์ •ํ•˜๊ธฐ"
276+
applyButton.isHidden = false
277+
reviseButton.isHidden = true
278+
deleteButton.isHidden = true
279+
case .viewing:
280+
titleLabel.text = "์ž‘์„ฑํ•œ ํ…Œ์ด์ŠคํŒ… ๋…ธํŠธ"
281+
applyButton.isHidden = true
282+
reviseButton.isHidden = false
283+
deleteButton.isHidden = false
284+
}
285+
}
275286
}
276287

277288
struct TastingTagDTO {
@@ -360,6 +371,7 @@ extension WritingNoteViewController: UICollectionViewDataSource{
360371
cell.selectedTagListClosure = { [weak self] indexArray in
361372
self?.selectedTags = indexArray.map { TastingTagDTO(id: $0) }
362373
}
374+
363375
cell.bind(with: self.tagOptions)
364376
cell.setLayout(for: writingstatus)
365377
return cell

0 commit comments

Comments
ย (0)