From d8145e384c43a938b43f207ba5c07a18d2974e7f Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:49:57 +0900 Subject: [PATCH 01/16] =?UTF-8?q?feat:=20=E2=9C=A8=20=20IssueTableView=20C?= =?UTF-8?q?ell=20=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/IssueTableViewCell.swift | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift new file mode 100644 index 000000000..c6dc8ec32 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift @@ -0,0 +1,112 @@ +// +// LabelTableViewCell.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/09. +// + +import UIKit +import SnapKit + +class IssueTableViewCell: UITableViewCell { + + static var identifier = "IssueTableViewCell" + + var largeTitle: UILabel = { + var label = UILabel() + label.font = UIFont.boldSystemFont(ofSize: 22) + return label + }() + + var labelDescription: UILabel = { + var label = UILabel() + label.textColor = .lightGray + return label + }() + + var milestoneView: MilestoneView = { + var milestone = MilestoneView() + return milestone + }() + + var labelView: PaddingLabel = { + var label = PaddingLabel(withInsets: 0, 0, 10, 10) + label.textAlignment = .center + label.textColor = .white + label.layer.masksToBounds = true + label.layer.cornerRadius = 15 + return label + }() + + var checkBoxImageView: UIImageView = { + var imageView = UIImageView() + imageView.image = UIImage(systemName: "checkmark.circle.fill") + return imageView + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + addSubviews() + setAutolayout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func addSubviews() { + addSubview(labelView) + addSubview(labelDescription) + addSubview(milestoneView) + addSubview(largeTitle) + } + + func setAutolayout() { + largeTitle.snp.makeConstraints { title in + title.top.equalTo(24) + title.leading.trailing.equalTo(16) + title.height.equalTo(28) + } + + labelDescription.snp.makeConstraints { label in + label.top.equalTo(largeTitle.snp.bottom).offset(16) + label.leading.trailing.equalToSuperview().offset(16) + label.height.equalTo(22) + } + + milestoneView.snp.makeConstraints { view in + view.top.equalTo(labelDescription.snp.bottom).offset(16) + view.leading.trailing.equalTo(16) + view.height.equalTo(22) + } + + labelView.snp.makeConstraints { view in + view.top.equalTo(milestoneView.snp.bottom).offset(16) + view.leading.equalTo(16) + view.width.greaterThanOrEqualTo(30) + view.height.equalTo(30) + } + } + + func setIssueCell(title: String, description: String, milestoneTitle: String, color: String) { + self.largeTitle.text = title + self.labelDescription.text = description + self.milestoneView.setMilestoneTitle(title: milestoneTitle) + self.labelView.backgroundColor = UIColor.hexStringToUIColor(hex: color) + self.labelView.text = "레이블 이름" + } + + func check() { + addSubview(checkBoxImageView) + + checkBoxImageView.snp.makeConstraints { image in + image.top.equalToSuperview().inset(24) + image.trailing.equalToSuperview().inset(16) + image.width.height.equalTo(30) + } + } + + func uncheck() { + checkBoxImageView.removeFromSuperview() + } +} From 5c87910df7de778e2cd320c95afe1b185db4ecc5 Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:50:27 +0900 Subject: [PATCH 02/16] =?UTF-8?q?feat:=20=E2=9C=A8=20=20IssueTableFooterVi?= =?UTF-8?q?ew=20=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/IssueTableFooterView.swift | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/Controller/IssueTableFooterView.swift diff --git a/iOS/issue-tracker/issue-tracker/Controller/IssueTableFooterView.swift b/iOS/issue-tracker/issue-tracker/Controller/IssueTableFooterView.swift new file mode 100644 index 000000000..aa26b6d6a --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/Controller/IssueTableFooterView.swift @@ -0,0 +1,41 @@ +// +// IssueTableFooterView.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/10. +// + +import UIKit +import SnapKit + +class IssueTableFooterView: UIView { + + var label: UILabel = { + var label = UILabel() + label.text = "아래로 당기면 검색바가 보여요!👀" + label.textColor = .lightGray + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + backgroundColor = #colorLiteral(red: 0.9489405751, green: 0.9490727782, blue: 0.9685038924, alpha: 1) + addSubview(label) + setAutolayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + backgroundColor = #colorLiteral(red: 0.9489405751, green: 0.9490727782, blue: 0.9685038924, alpha: 1) + addSubview(label) + setAutolayout() + } + + func setAutolayout() { + label.snp.makeConstraints { label in + label.centerX.equalToSuperview() + label.top.equalTo(39) + } + } + +} From 6ec6a5d7ec3fe1229ccf1888dabeb8417b47a0b1 Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:50:57 +0900 Subject: [PATCH 03/16] =?UTF-8?q?feat:=20=E2=9C=A8=20AddIssueButton=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/AddIssueButton.swift | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/AddIssueButton.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/AddIssueButton.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/AddIssueButton.swift new file mode 100644 index 000000000..0b0320e9d --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/AddIssueButton.swift @@ -0,0 +1,38 @@ +// +// AddIssueButton.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/11. +// + +import UIKit + +class AddIssueButton: UIView { + + override init(frame: CGRect) { + super.init(frame: frame) + setButton() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + override func draw(_ rect: CGRect) { + let path = UIBezierPath() + + path.move(to: CGPoint(x: self.bounds.width * 0.25, y: self.bounds.height * 0.5)) + path.addLine(to: CGPoint(x: self.bounds.width * 0.75, y: self.bounds.height * 0.5)) + path.move(to: CGPoint(x: self.bounds.width * 0.5, y: self.bounds.height * 0.25)) + path.addLine(to: CGPoint(x: self.bounds.width * 0.5, y: self.bounds.height * 0.75)) + UIColor.white.set() + path.stroke() + } + + func setButton() { + clipsToBounds = true + layer.cornerRadius = self.bounds.size.width * 0.5 + backgroundColor = .systemBlue + + } +} From 23f226159faca90ba779dc2357adc9343308b87b Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:51:21 +0900 Subject: [PATCH 04/16] =?UTF-8?q?feat:=20=E2=9C=A8=20FilterBarButton=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/FilterBarButton.swift | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/FilterBarButton.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/FilterBarButton.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/FilterBarButton.swift new file mode 100644 index 000000000..32e706bb6 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/FilterBarButton.swift @@ -0,0 +1,21 @@ +// +// FilterBarButtonView.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/10. +// + +import UIKit + +class FilterBarButton: UIButton { + override init(frame: CGRect) { + super.init(frame: frame) + setImage(UIImage(systemName: "doc.text.magnifyingglass"), for: .normal) + setTitle("필터", for: .normal) + setTitleColor(.systemBlue, for: .normal) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} From de79d82150b567bc99fc5ca63666a3107e84fc7a Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:51:43 +0900 Subject: [PATCH 05/16] =?UTF-8?q?feat:=20=E2=9C=A8=20CancelBarButton=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/CancelButton.swift | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/CancelButton.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/CancelButton.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/CancelButton.swift new file mode 100644 index 000000000..ce0d044b6 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/CancelButton.swift @@ -0,0 +1,20 @@ +// +// CancelButton.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/11. +// + +import UIKit + +class CancelButton: UIButton { + override init(frame: CGRect) { + super.init(frame: frame) + setTitle("취소", for: .normal) + setTitleColor(.systemBlue, for: .normal) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} From 4d41875ee38801538e72f7f7f7c865cddb5ff1f8 Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:52:23 +0900 Subject: [PATCH 06/16] =?UTF-8?q?feat:=20=E2=9C=A8=20SelectBarButton=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/SelectBarButton.swift | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/SelectBarButton.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/SelectBarButton.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/SelectBarButton.swift new file mode 100644 index 000000000..06c8b4563 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/SelectBarButton.swift @@ -0,0 +1,22 @@ +// +// SelectBarButton.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/10. +// + +import UIKit + +class SelectBarButton: UIButton { + override init(frame: CGRect) { + super.init(frame: frame) + setImage(UIImage(systemName: "checkmark.circle"), for: .normal) + setTitle("선택", for: .normal) + setTitleColor(.systemBlue, for: .normal) + semanticContentAttribute = .forceRightToLeft + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} From d07f51c2f7eff391b50170649125d05afabc8399 Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:54:21 +0900 Subject: [PATCH 07/16] =?UTF-8?q?feat:=20=E2=9C=A8=20MilestoneView=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/MilestoneView.swift | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/MilestoneView.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/MilestoneView.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/MilestoneView.swift new file mode 100644 index 000000000..5442fe148 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/MilestoneView.swift @@ -0,0 +1,56 @@ +// +// MilestoneView.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/10. +// + +import UIKit +import SnapKit + +class MilestoneView: UIView { + var sfsymbolImageView: UIImageView = { + var imageView = UIImageView() + imageView.image = UIImage(named: "vector") + return imageView + }() + + var milestoneTitle: UILabel = { + var label = UILabel() + label.textColor = .lightGray + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + addSubviews() + setAutolayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + addSubviews() + setAutolayout() + } + + func addSubviews() { + addSubview(sfsymbolImageView) + addSubview(milestoneTitle) + } + + func setAutolayout() { + sfsymbolImageView.snp.makeConstraints { imageView in + imageView.top.leading.bottom.equalToSuperview() + imageView.width.equalTo(sfsymbolImageView.snp.height).multipliedBy(1) + } + milestoneTitle.snp.makeConstraints { label in + label.top.bottom.equalToSuperview() + label.leading.equalTo(sfsymbolImageView.snp.trailing).offset(4) + label.width.greaterThanOrEqualTo(30) + } + } + + func setMilestoneTitle(title: String) { + self.milestoneTitle.text = title + } +} From 315f4db49d80bae50bc58ad49c63925908bc0c6a Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 17:54:52 +0900 Subject: [PATCH 08/16] =?UTF-8?q?feat:=20=E2=9C=A8=20IssueToolbar=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/IssueToolbar.swift | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/Controller/IssueToolbar.swift diff --git a/iOS/issue-tracker/issue-tracker/Controller/IssueToolbar.swift b/iOS/issue-tracker/issue-tracker/Controller/IssueToolbar.swift new file mode 100644 index 000000000..cb1a101be --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/Controller/IssueToolbar.swift @@ -0,0 +1,64 @@ +// +// IssueToolbar.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/11. +// + +import UIKit + +class IssueToolbar: UIToolbar { + + let checkBoxBarButtonItem: UIBarButtonItem = { + var item = UIBarButtonItem() + item.image = UIImage(systemName: "checkmark.circle") + + return item + }() + + let closeIssueBarButtonItem: UIBarButtonItem = { + var item = UIBarButtonItem() + item.image = UIImage(systemName: "archivebox") + return item + }() + + let labelBarButtonItem: UIBarButtonItem = { + var item = UIBarButtonItem() + item.title = "이슈를 선택하세요" + item.isEnabled = false + return item + }() + + let flexibleBarButtonItem: UIBarButtonItem = { + var item = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) + return item + }() + + override init(frame: CGRect) { + super.init(frame: frame) + setToolbar() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + setToolbar() + } + + func setToolbar() { + let items = [checkBoxBarButtonItem, flexibleBarButtonItem, labelBarButtonItem, flexibleBarButtonItem, closeIssueBarButtonItem] + setItems(items, animated: false) + + } + + func setCheckMode(count: Int) { + checkBoxBarButtonItem.image = UIImage(systemName: "checkmark.circle") + labelBarButtonItem.title = "\(count)개의 이슈가 선택됨" + labelBarButtonItem.tintColor = .black + } + + func setUncheckMode() { + checkBoxBarButtonItem.image = UIImage(systemName: "checkmark.circle.fill") + labelBarButtonItem.title = "이슈를 선택하세요" + labelBarButtonItem.tintColor = .lightGray + } +} From e6a5acba03154e2f2331a3ecf35b4ed0c6bd4358 Mon Sep 17 00:00:00 2001 From: zeke Date: Fri, 11 Jun 2021 18:05:44 +0900 Subject: [PATCH 09/16] =?UTF-8?q?feat:=20=E2=9C=A8=20IssueListViewControll?= =?UTF-8?q?er=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issue-tracker.xcodeproj/project.pbxproj | 44 ++++++ .../issue-tracker/Base.lproj/Main.storyboard | 56 +++++-- .../View/IssueListViewController.swift | 137 ++++++++++++++++++ 3 files changed, 226 insertions(+), 11 deletions(-) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueListViewController.swift diff --git a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj index ce7315c6e..921dc735f 100644 --- a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj +++ b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj @@ -12,6 +12,13 @@ 8345AD7BD9CAFAD9A4F8374A /* Pods_issue_tracker_issue_trackerUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0166F39C919837292E32AEF /* Pods_issue_tracker_issue_trackerUITests.framework */; }; 8D53899997C8120B27C2FB4A /* Pods_issue_trackerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57FD79E124256E10A8CD0326 /* Pods_issue_trackerTests.framework */; }; 9F61736E94FA27116F3653A8 /* Pods_issue_tracker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DCF55CDC3CD94CD2F1208E5 /* Pods_issue_tracker.framework */; }; + B32FEAC12671D9F600BF37A1 /* IssueListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEAC02671D9F600BF37A1 /* IssueListViewController.swift */; }; + B32FEAC32671DCB100BF37A1 /* IssueTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEAC22671DCB100BF37A1 /* IssueTableViewCell.swift */; }; + B32FEAC62671DDA600BF37A1 /* MilestoneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEAC52671DDA600BF37A1 /* MilestoneView.swift */; }; + B32FEAC82671F65F00BF37A1 /* FilterBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEAC72671F65F00BF37A1 /* FilterBarButton.swift */; }; + B32FEACA2671FD1600BF37A1 /* SelectBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEAC92671FD1600BF37A1 /* SelectBarButton.swift */; }; + B32FEACC26724CF400BF37A1 /* IssueTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEACB26724CF400BF37A1 /* IssueTableFooterView.swift */; }; + B32FEACE267260E400BF37A1 /* AddIssueButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FEACD267260E400BF37A1 /* AddIssueButton.swift */; }; B349997D266F8D0B0091A44A /* GitHubLoginButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B349997C266F8D0B0091A44A /* GitHubLoginButton.swift */; }; B349997F266F90710091A44A /* AppleLoginButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B349997E266F90710091A44A /* AppleLoginButton.swift */; }; B3B559E1266E095E00901C55 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B559E0266E095E00901C55 /* AppDelegate.swift */; }; @@ -26,6 +33,8 @@ B3F527582670A3F3002B0812 /* LabelTabelHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */; }; B3F5275A2670A4BD002B0812 /* AddButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527592670A4BD002B0812 /* AddButton.swift */; }; B3F5275C2670C0EF002B0812 /* PaddingLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */; }; + B3FBA7B726730B9A0006E5E6 /* IssueToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */; }; + B3FBA7B9267335C30006E5E6 /* CancelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FBA7B8267335C30006E5E6 /* CancelButton.swift */; }; D0ADB694266F0A5000E0762C /* Endpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0ADB693266F0A5000E0762C /* Endpoint.swift */; }; D0ADB699266F0C1300E0762C /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0ADB698266F0C1300E0762C /* NetworkManager.swift */; }; D0ADB6CC266F4F1C00E0762C /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = D0ADB6CB266F4F1C00E0762C /* Alamofire */; }; @@ -67,6 +76,13 @@ 702E8D2AD8B572CC0A3F3F24 /* Pods-issue-tracker-issue-trackerUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-issue-tracker-issue-trackerUITests.release.xcconfig"; path = "Target Support Files/Pods-issue-tracker-issue-trackerUITests/Pods-issue-tracker-issue-trackerUITests.release.xcconfig"; sourceTree = ""; }; A36EB985C6FE14BAF28D126D /* Pods-issue-trackerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-issue-trackerTests.debug.xcconfig"; path = "Target Support Files/Pods-issue-trackerTests/Pods-issue-trackerTests.debug.xcconfig"; sourceTree = ""; }; B2AD0081C0EB261B3FEA9CF7 /* Pods-issue-tracker-issue-trackerUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-issue-tracker-issue-trackerUITests.debug.xcconfig"; path = "Target Support Files/Pods-issue-tracker-issue-trackerUITests/Pods-issue-tracker-issue-trackerUITests.debug.xcconfig"; sourceTree = ""; }; + B32FEAC02671D9F600BF37A1 /* IssueListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = IssueListViewController.swift; path = "issue-tracker/View/IssueListViewController.swift"; sourceTree = SOURCE_ROOT; }; + B32FEAC22671DCB100BF37A1 /* IssueTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IssueTableViewCell.swift; sourceTree = ""; }; + B32FEAC52671DDA600BF37A1 /* MilestoneView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MilestoneView.swift; sourceTree = ""; }; + B32FEAC72671F65F00BF37A1 /* FilterBarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterBarButton.swift; sourceTree = ""; }; + B32FEAC92671FD1600BF37A1 /* SelectBarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectBarButton.swift; sourceTree = ""; }; + B32FEACB26724CF400BF37A1 /* IssueTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = IssueTableFooterView.swift; path = "issue-tracker/Controller/IssueTableFooterView.swift"; sourceTree = SOURCE_ROOT; }; + B32FEACD267260E400BF37A1 /* AddIssueButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddIssueButton.swift; sourceTree = ""; }; B349997C266F8D0B0091A44A /* GitHubLoginButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GitHubLoginButton.swift; sourceTree = ""; }; B349997E266F90710091A44A /* AppleLoginButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginButton.swift; sourceTree = ""; }; B3B559DD266E095E00901C55 /* issue-tracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "issue-tracker.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -88,6 +104,8 @@ B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelTabelHeaderView.swift; sourceTree = ""; }; B3F527592670A4BD002B0812 /* AddButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddButton.swift; sourceTree = ""; }; B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaddingLabel.swift; sourceTree = ""; }; + B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = IssueToolbar.swift; path = "issue-tracker/Controller/IssueToolbar.swift"; sourceTree = SOURCE_ROOT; }; + B3FBA7B8267335C30006E5E6 /* CancelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CancelButton.swift; sourceTree = ""; }; CCF0F131FB8BE0BC0EF7FE4E /* Pods-issue-tracker.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-issue-tracker.release.xcconfig"; path = "Target Support Files/Pods-issue-tracker/Pods-issue-tracker.release.xcconfig"; sourceTree = ""; }; D0ADB693266F0A5000E0762C /* Endpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Endpoint.swift; sourceTree = ""; }; D0ADB698266F0C1300E0762C /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = ""; }; @@ -136,6 +154,7 @@ 49903DAC266F558700D2A6DD /* View */ = { isa = PBXGroup; children = ( + B32FEAC42671DCD200BF37A1 /* IssueList */, D0FD50F12671B108008C6031 /* Label */, D0FD50ED2671B0E8008C6031 /* Milestone */, B3F5274F26709614002B0812 /* Login */, @@ -143,6 +162,21 @@ path = View; sourceTree = ""; }; + B32FEAC42671DCD200BF37A1 /* IssueList */ = { + isa = PBXGroup; + children = ( + B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */, + B32FEACD267260E400BF37A1 /* AddIssueButton.swift */, + B32FEACB26724CF400BF37A1 /* IssueTableFooterView.swift */, + B32FEAC22671DCB100BF37A1 /* IssueTableViewCell.swift */, + B32FEAC52671DDA600BF37A1 /* MilestoneView.swift */, + B32FEAC72671F65F00BF37A1 /* FilterBarButton.swift */, + B3FBA7B8267335C30006E5E6 /* CancelButton.swift */, + B32FEAC92671FD1600BF37A1 /* SelectBarButton.swift */, + ); + path = IssueList; + sourceTree = ""; + }; B3B559D4266E095E00901C55 = { isa = PBXGroup; children = ( @@ -240,6 +274,7 @@ D0FD50E92671B0AD008C6031 /* Controller */ = { isa = PBXGroup; children = ( + B32FEAC02671D9F600BF37A1 /* IssueListViewController.swift */, B3B559E4266E095E00901C55 /* LoginViewController.swift */, B3F527502670968F002B0812 /* LabelViewController.swift */, D0FD50A9267096C0008C6031 /* MilestoneViewController.swift */, @@ -505,23 +540,32 @@ buildActionMask = 2147483647; files = ( B3F527512670968F002B0812 /* LabelViewController.swift in Sources */, + B3FBA7B726730B9A0006E5E6 /* IssueToolbar.swift in Sources */, D0FD509E26708DDE008C6031 /* LoginViewController.swift in Sources */, + B32FEACC26724CF400BF37A1 /* IssueTableFooterView.swift in Sources */, B3F5275A2670A4BD002B0812 /* AddButton.swift in Sources */, + B32FEAC12671D9F600BF37A1 /* IssueListViewController.swift in Sources */, + B32FEACA2671FD1600BF37A1 /* SelectBarButton.swift in Sources */, B3F5275C2670C0EF002B0812 /* PaddingLabel.swift in Sources */, D0FD50DC2671AA04008C6031 /* InputView.swift in Sources */, + B32FEAC32671DCB100BF37A1 /* IssueTableViewCell.swift in Sources */, 49903DAB266F558300D2A6DD /* LoginView.swift in Sources */, D0FD50F72671B156008C6031 /* LabelTableViewCell.swift in Sources */, D0FD50D4267192AF008C6031 /* AddViewController.swift in Sources */, + B32FEACE267260E400BF37A1 /* AddIssueButton.swift in Sources */, 49903DAE266F588B00D2A6DD /* IDPasswordTextField.swift in Sources */, B349997D266F8D0B0091A44A /* GitHubLoginButton.swift in Sources */, B3F527552670A0CD002B0812 /* UIColor+HexInit.swift in Sources */, B349997F266F90710091A44A /* AppleLoginButton.swift in Sources */, + B32FEAC82671F65F00BF37A1 /* FilterBarButton.swift in Sources */, D0ADB6F8266F5BBE00E0762C /* OAuthManager.swift in Sources */, B3B559E1266E095E00901C55 /* AppDelegate.swift in Sources */, D0ADB699266F0C1300E0762C /* NetworkManager.swift in Sources */, B3F527582670A3F3002B0812 /* LabelTabelHeaderView.swift in Sources */, + B3FBA7B9267335C30006E5E6 /* CancelButton.swift in Sources */, D0ADB694266F0A5000E0762C /* Endpoint.swift in Sources */, B3B559E3266E095E00901C55 /* SceneDelegate.swift in Sources */, + B32FEAC62671DDA600BF37A1 /* MilestoneView.swift in Sources */, D0FD50AA267096C0008C6031 /* MilestoneViewController.swift in Sources */, D0FD50BB26709F8B008C6031 /* MilestoneTableViewCell.swift in Sources */, ); diff --git a/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard b/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard index 5523799ea..ab281bb18 100644 --- a/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard +++ b/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -37,21 +37,36 @@ - + - + + + + + + + + + + + + + - + + + + - + @@ -82,7 +97,7 @@ - + @@ -98,7 +113,7 @@ - + @@ -114,7 +129,7 @@ - + @@ -127,7 +142,7 @@ - + @@ -154,7 +169,26 @@ - + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/issue-tracker/issue-tracker/View/IssueListViewController.swift b/iOS/issue-tracker/issue-tracker/View/IssueListViewController.swift new file mode 100644 index 000000000..4c68ced0c --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueListViewController.swift @@ -0,0 +1,137 @@ +// +// IssueListViewController.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/10. +// + +import UIKit +import SnapKit + +class IssueListViewController: UIViewController { + + @IBOutlet weak var issueTableView: UITableView! + + let addIssueButton = AddIssueButton(frame: CGRect(x: 0, y: 0, width: 64, height: 64)) + let filterBarButton = FilterBarButton() + let selectBarButton = SelectBarButton() + let cancelButton = CancelButton() + let issueToolbar = IssueToolbar(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) + let searchController: UISearchController = { + var searchController = UISearchController(searchResultsController: nil) + searchController.searchBar.setImage(UIImage(systemName: "mic.fill"), for: .bookmark, state: .normal) + searchController.searchBar.showsBookmarkButton = true + return searchController + }() + + override func viewDidLoad() { + super.viewDidLoad() + setNavigationItem() + setIssueTableView() + setAddIssueButtonAutolayout() + filterBarButton.addTarget(self, action: #selector(filterButtonTapped), for: .touchUpInside) + selectBarButton.addTarget(self, action: #selector(selectButtonTapped), for: .touchUpInside) + addIssueButton.addGestureRecognizer(UIGestureRecognizer(target: self, action: #selector(addIssueButtonTapped))) + cancelButton.addTarget(self, action: #selector(cancelButtonTapped), for: .touchUpInside) + } + + @objc func filterButtonTapped() { + + } + + @objc func selectButtonTapped() { + navigationItem.leftBarButtonItem = nil + navigationItem.rightBarButtonItem = UIBarButtonItem(customView: cancelButton) + navigationItem.title = "이슈 선택" + navigationItem.searchController = nil + tabBarController?.tabBar.isHidden = true + view.addSubview(issueToolbar) + setToolbarAutoulayout() + } + + @objc func addIssueButtonTapped() { + + + } + + @objc func cancelButtonTapped() { + setNavigationItem() + tabBarController?.tabBar.isHidden = false + issueToolbar.removeFromSuperview() + } + + func setAddIssueButtonAutolayout() { + view.addSubview(addIssueButton) + addIssueButton.snp.makeConstraints { button in + button.width.height.equalTo(64) + button.trailing.equalToSuperview().offset(-16) + button.bottom.equalToSuperview().offset(-100) + } + } + + func setToolbarAutoulayout() { + issueToolbar.snp.makeConstraints { toolbar in + toolbar.leading.trailing.equalToSuperview() + toolbar.bottom.equalTo(view.safeAreaLayoutGuide) + toolbar.height.equalTo(44) + } + } + + func setNavigationItem() { + navigationController?.navigationBar.prefersLargeTitles = true + navigationItem.title = "이슈" + navigationItem.leftBarButtonItem = UIBarButtonItem(customView: filterBarButton) + navigationItem.rightBarButtonItem = UIBarButtonItem(customView: selectBarButton) + navigationItem.searchController = searchController + } + + func setIssueTableView() { + issueTableView.register(IssueTableViewCell.self, forCellReuseIdentifier: IssueTableViewCell.identifier) + issueTableView.allowsMultipleSelection = true + issueTableView.dataSource = self + issueTableView.delegate = self + issueTableView.tableFooterView = IssueTableFooterView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 300)) + } +} + +extension IssueListViewController: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 2 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: IssueTableViewCell.identifier) as? IssueTableViewCell else { return UITableViewCell() } + cell.setIssueCell(title: "제목", description: "이슈에 대한 설명", milestoneTitle: "마일스톤 이름", color: "#DFCD85") + return cell + } +} + +extension IssueListViewController: UITableViewDelegate { + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + guard let cell = tableView.cellForRow(at: indexPath) as? IssueTableViewCell else { return } + cell.selectionStyle = .none + cell.check() + + } + + func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { + guard let cell = tableView.cellForRow(at: indexPath) as? IssueTableViewCell else { return } + cell.uncheck() + } + + func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { + let deleteAction = UIContextualAction(style: .destructive, title: "삭제") { ac, view, success in + success(true) + } + + let shareAction = UIContextualAction(style: .normal, title: "닫기") { ac, view, success in + success(true) + } + + deleteAction.image = UIImage(systemName: "trash") + shareAction.image = UIImage(systemName: "archivebox") + shareAction.backgroundColor = #colorLiteral(red: 0.7988751531, green: 0.8300203681, blue: 0.9990373254, alpha: 1) + + return UISwipeActionsConfiguration(actions: [shareAction, deleteAction]) + } +} From 495ec506f4b0bfab6d88f6305091babbe1b2ae46 Mon Sep 17 00:00:00 2001 From: zeke Date: Sun, 13 Jun 2021 17:12:38 +0900 Subject: [PATCH 10/16] =?UTF-8?q?chore:=20=F0=9F=94=A7=20AddIssueButton=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issue-tracker/View/Label/AddButton.swift | 56 ------------------- .../View/Label/AddLabelButton.swift | 22 ++++++++ 2 files changed, 22 insertions(+), 56 deletions(-) delete mode 100644 iOS/issue-tracker/issue-tracker/View/Label/AddButton.swift create mode 100644 iOS/issue-tracker/issue-tracker/View/Label/AddLabelButton.swift diff --git a/iOS/issue-tracker/issue-tracker/View/Label/AddButton.swift b/iOS/issue-tracker/issue-tracker/View/Label/AddButton.swift deleted file mode 100644 index b497e0d11..000000000 --- a/iOS/issue-tracker/issue-tracker/View/Label/AddButton.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// AddButton.swift -// issue-tracker -// -// Created by 양준혁 on 2021/06/09. -// - -import UIKit -import SnapKit - -class AddButton: UIView { - - var addText: UILabel = { - var label = UILabel() - label.text = "추가" - label.textColor = .systemBlue - return label - }() - - var addImage: UIImageView = { - var imageView = UIImageView() - imageView.image = UIImage(systemName: "plus") - return imageView - }() - - override init(frame: CGRect) { - super.init(frame: frame) - addViews() - setAutolayout() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - setAutolayout() - } - - func addViews() { - self.addSubview(addText) - self.addSubview(addImage) - } - - func setAutolayout() { - addText.snp.makeConstraints { text in - text.top.leading.equalTo(10) - text.width.equalTo(32) - text.height.equalTo(22) - } - - addImage.snp.makeConstraints { image in - image.top.equalTo(10) - image.leading.equalTo(addText.snp.trailing).offset(10) - image.width.equalTo(17) - image.height.equalTo(21) - } - } -} diff --git a/iOS/issue-tracker/issue-tracker/View/Label/AddLabelButton.swift b/iOS/issue-tracker/issue-tracker/View/Label/AddLabelButton.swift new file mode 100644 index 000000000..c9c0aac38 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/Label/AddLabelButton.swift @@ -0,0 +1,22 @@ +// +// AddLabelButton.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/13. +// + +import UIKit + +class AddLabelButton: UIButton { + override init(frame: CGRect) { + super.init(frame: frame) + setImage(UIImage(systemName: "plus"), for: .normal) + setTitle("추가", for: .normal) + setTitleColor(.systemBlue, for: .normal) + semanticContentAttribute = .forceRightToLeft + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} From 57faa75de954ea90c77479cfd3a55029da3a7ce4 Mon Sep 17 00:00:00 2001 From: zeke Date: Sun, 13 Jun 2021 17:14:38 +0900 Subject: [PATCH 11/16] =?UTF-8?q?chore:=20=F0=9F=94=A7=20Change=20Issue=20?= =?UTF-8?q?check=20way=20removeFromSuperView=20to=20Hidden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/IssueTableViewCell.swift | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift index c6dc8ec32..01de5834b 100644 --- a/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift @@ -48,6 +48,7 @@ class IssueTableViewCell: UITableViewCell { super.init(style: style, reuseIdentifier: reuseIdentifier) addSubviews() setAutolayout() + checkBoxImageView.isHidden = true } required init?(coder: NSCoder) { @@ -59,6 +60,7 @@ class IssueTableViewCell: UITableViewCell { addSubview(labelDescription) addSubview(milestoneView) addSubview(largeTitle) + addSubview(checkBoxImageView) } func setAutolayout() { @@ -86,6 +88,14 @@ class IssueTableViewCell: UITableViewCell { view.width.greaterThanOrEqualTo(30) view.height.equalTo(30) } + + checkBoxImageView.snp.makeConstraints { image in + image.top.equalToSuperview().inset(24) + image.trailing.equalToSuperview().inset(16) + image.width.height.equalTo(30) + } + + } func setIssueCell(title: String, description: String, milestoneTitle: String, color: String) { @@ -97,16 +107,10 @@ class IssueTableViewCell: UITableViewCell { } func check() { - addSubview(checkBoxImageView) - - checkBoxImageView.snp.makeConstraints { image in - image.top.equalToSuperview().inset(24) - image.trailing.equalToSuperview().inset(16) - image.width.height.equalTo(30) - } + checkBoxImageView.isHidden = false } func uncheck() { - checkBoxImageView.removeFromSuperview() + checkBoxImageView.isHidden = true } } From 4f30d3b1a071184d1dd5a86974fa1c79d0dfc465 Mon Sep 17 00:00:00 2001 From: zeke Date: Sun, 13 Jun 2021 17:15:12 +0900 Subject: [PATCH 12/16] =?UTF-8?q?chore:=20=F0=9F=94=A7=20LabelViewControll?= =?UTF-8?q?er=EC=9D=98=20HeaderView=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issue-tracker.xcodeproj/project.pbxproj | 8 ++--- .../issue-tracker/Base.lproj/Main.storyboard | 33 +++++++++++++++---- .../Controller/LabelViewController.swift | 15 ++++++++- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj index 921dc735f..7ec7039c3 100644 --- a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj +++ b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj @@ -28,10 +28,10 @@ B3B559ED266E096000901C55 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B3B559EB266E096000901C55 /* LaunchScreen.storyboard */; }; B3B559F8266E096000901C55 /* issue_trackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B559F7266E096000901C55 /* issue_trackerTests.swift */; }; B3B55A03266E096000901C55 /* issue_trackerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B55A02266E096000901C55 /* issue_trackerUITests.swift */; }; + B3EADABE2675EFED0007C4B6 /* AddLabelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */; }; B3F527512670968F002B0812 /* LabelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527502670968F002B0812 /* LabelViewController.swift */; }; B3F527552670A0CD002B0812 /* UIColor+HexInit.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527542670A0CD002B0812 /* UIColor+HexInit.swift */; }; B3F527582670A3F3002B0812 /* LabelTabelHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */; }; - B3F5275A2670A4BD002B0812 /* AddButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527592670A4BD002B0812 /* AddButton.swift */; }; B3F5275C2670C0EF002B0812 /* PaddingLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */; }; B3FBA7B726730B9A0006E5E6 /* IssueToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */; }; B3FBA7B9267335C30006E5E6 /* CancelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FBA7B8267335C30006E5E6 /* CancelButton.swift */; }; @@ -99,10 +99,10 @@ B3B559FE266E096000901C55 /* issue-trackerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "issue-trackerUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; B3B55A02266E096000901C55 /* issue_trackerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = issue_trackerUITests.swift; sourceTree = ""; }; B3B55A04266E096000901C55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLabelButton.swift; sourceTree = ""; }; B3F527502670968F002B0812 /* LabelViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelViewController.swift; sourceTree = ""; }; B3F527542670A0CD002B0812 /* UIColor+HexInit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+HexInit.swift"; sourceTree = ""; }; B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelTabelHeaderView.swift; sourceTree = ""; }; - B3F527592670A4BD002B0812 /* AddButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddButton.swift; sourceTree = ""; }; B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaddingLabel.swift; sourceTree = ""; }; B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = IssueToolbar.swift; path = "issue-tracker/Controller/IssueToolbar.swift"; sourceTree = SOURCE_ROOT; }; B3FBA7B8267335C30006E5E6 /* CancelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CancelButton.swift; sourceTree = ""; }; @@ -297,7 +297,7 @@ children = ( D0FD50F62671B156008C6031 /* LabelTableViewCell.swift */, B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */, - B3F527592670A4BD002B0812 /* AddButton.swift */, + B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */, B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */, ); path = Label; @@ -543,7 +543,7 @@ B3FBA7B726730B9A0006E5E6 /* IssueToolbar.swift in Sources */, D0FD509E26708DDE008C6031 /* LoginViewController.swift in Sources */, B32FEACC26724CF400BF37A1 /* IssueTableFooterView.swift in Sources */, - B3F5275A2670A4BD002B0812 /* AddButton.swift in Sources */, + B3EADABE2675EFED0007C4B6 /* AddLabelButton.swift in Sources */, B32FEAC12671D9F600BF37A1 /* IssueListViewController.swift in Sources */, B32FEACA2671FD1600BF37A1 /* SelectBarButton.swift in Sources */, B3F5275C2670C0EF002B0812 /* PaddingLabel.swift in Sources */, diff --git a/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard b/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard index ab281bb18..09d35b426 100644 --- a/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard +++ b/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard @@ -68,7 +68,7 @@ - + @@ -90,14 +90,14 @@ - + - + @@ -113,7 +113,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -190,6 +190,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift b/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift index c4de10d7d..1e77a8919 100644 --- a/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift +++ b/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift @@ -17,14 +17,27 @@ class LabelViewController: UIViewController { @IBOutlet weak var labelTableView: UITableView! + var addLabelButton = AddLabelButton() + lazy var tableHeaderView = LabelTabelHeaderView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 140)) let fakeData = [Label(title: "hidsfadsfsafasfdfadsf", description: "hello", color: "#B1CAE5"), Label(title: "wow", description: "amazing", color: "#DFCD85")] override func viewDidLoad() { super.viewDidLoad() + setNavigationBar() labelTableView.register(LabelTableViewCell.self, forCellReuseIdentifier: LabelTableViewCell.identifier) labelTableView.dataSource = self - labelTableView.tableHeaderView = tableHeaderView + addLabelButton.addTarget(self, action: #selector(addLabelButtonTapped), for: .touchUpInside) + } + + @objc func addLabelButtonTapped() { + + } + + func setNavigationBar() { + navigationController?.navigationBar.prefersLargeTitles = true + navigationItem.title = "레이블" + navigationItem.rightBarButtonItem = UIBarButtonItem(customView: addLabelButton) } } From 43307068cb9e589683c88fdb48e1d7f62e7fe20a Mon Sep 17 00:00:00 2001 From: zeke Date: Sun, 13 Jun 2021 18:08:18 +0900 Subject: [PATCH 13/16] =?UTF-8?q?chore:=20=F0=9F=94=A7=20LabelTableHeaderV?= =?UTF-8?q?iew=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issue-tracker.xcodeproj/project.pbxproj | 4 -- .../Controller/LabelViewController.swift | 1 - .../View/Label/LabelTabelHeaderView.swift | 65 ------------------- 3 files changed, 70 deletions(-) delete mode 100644 iOS/issue-tracker/issue-tracker/View/Label/LabelTabelHeaderView.swift diff --git a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj index 7ec7039c3..efcc58d3f 100644 --- a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj +++ b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj @@ -31,7 +31,6 @@ B3EADABE2675EFED0007C4B6 /* AddLabelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */; }; B3F527512670968F002B0812 /* LabelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527502670968F002B0812 /* LabelViewController.swift */; }; B3F527552670A0CD002B0812 /* UIColor+HexInit.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527542670A0CD002B0812 /* UIColor+HexInit.swift */; }; - B3F527582670A3F3002B0812 /* LabelTabelHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */; }; B3F5275C2670C0EF002B0812 /* PaddingLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */; }; B3FBA7B726730B9A0006E5E6 /* IssueToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */; }; B3FBA7B9267335C30006E5E6 /* CancelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FBA7B8267335C30006E5E6 /* CancelButton.swift */; }; @@ -102,7 +101,6 @@ B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLabelButton.swift; sourceTree = ""; }; B3F527502670968F002B0812 /* LabelViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelViewController.swift; sourceTree = ""; }; B3F527542670A0CD002B0812 /* UIColor+HexInit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+HexInit.swift"; sourceTree = ""; }; - B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelTabelHeaderView.swift; sourceTree = ""; }; B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaddingLabel.swift; sourceTree = ""; }; B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = IssueToolbar.swift; path = "issue-tracker/Controller/IssueToolbar.swift"; sourceTree = SOURCE_ROOT; }; B3FBA7B8267335C30006E5E6 /* CancelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CancelButton.swift; sourceTree = ""; }; @@ -296,7 +294,6 @@ isa = PBXGroup; children = ( D0FD50F62671B156008C6031 /* LabelTableViewCell.swift */, - B3F527572670A3F3002B0812 /* LabelTabelHeaderView.swift */, B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */, B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */, ); @@ -561,7 +558,6 @@ D0ADB6F8266F5BBE00E0762C /* OAuthManager.swift in Sources */, B3B559E1266E095E00901C55 /* AppDelegate.swift in Sources */, D0ADB699266F0C1300E0762C /* NetworkManager.swift in Sources */, - B3F527582670A3F3002B0812 /* LabelTabelHeaderView.swift in Sources */, B3FBA7B9267335C30006E5E6 /* CancelButton.swift in Sources */, D0ADB694266F0A5000E0762C /* Endpoint.swift in Sources */, B3B559E3266E095E00901C55 /* SceneDelegate.swift in Sources */, diff --git a/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift b/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift index 1e77a8919..85fd2ee01 100644 --- a/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift +++ b/iOS/issue-tracker/issue-tracker/Controller/LabelViewController.swift @@ -19,7 +19,6 @@ class LabelViewController: UIViewController { var addLabelButton = AddLabelButton() - lazy var tableHeaderView = LabelTabelHeaderView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 140)) let fakeData = [Label(title: "hidsfadsfsafasfdfadsf", description: "hello", color: "#B1CAE5"), Label(title: "wow", description: "amazing", color: "#DFCD85")] override func viewDidLoad() { diff --git a/iOS/issue-tracker/issue-tracker/View/Label/LabelTabelHeaderView.swift b/iOS/issue-tracker/issue-tracker/View/Label/LabelTabelHeaderView.swift deleted file mode 100644 index 134439eed..000000000 --- a/iOS/issue-tracker/issue-tracker/View/Label/LabelTabelHeaderView.swift +++ /dev/null @@ -1,65 +0,0 @@ -// -// LabelTabelHeaderView.swift -// issue-tracker -// -// Created by 양준혁 on 2021/06/09. -// - -import UIKit -import SnapKit - -class LabelTabelHeaderView: UIView { - - var title: UILabel = { - var label = UILabel() - label.text = "레이블" - label.font = UIFont.boldSystemFont(ofSize: 34) - return label - }() - - var line: UIView = { - var view = UIView() - view.backgroundColor = .lightGray - return view - }() - - var button = AddButton() - - override init(frame: CGRect) { - super.init(frame: frame) - addSubViews() - setAutolayout() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - addSubViews() - setAutolayout() - } - - func addSubViews() { - self.addSubview(title) - self.addSubview(button) - self.addSubview(line) - } - - func setAutolayout() { - title.snp.makeConstraints { title in - title.top.equalToSuperview().offset(91) - title.leading.equalToSuperview().offset(16) - title.width.equalTo(94) - title.height.equalTo(41) - } - - button.snp.makeConstraints { button in - button.width.equalTo(85) - button.height.equalTo(44) - button.top.trailing.equalToSuperview() - } - - line.snp.makeConstraints { line in - line.leading.trailing.bottom.equalToSuperview() - line.height.equalTo(1) - } - } -} From b4202b1f114e1706c6d15c4447f4646217d2154e Mon Sep 17 00:00:00 2001 From: zeke Date: Mon, 14 Jun 2021 14:02:12 +0900 Subject: [PATCH 14/16] =?UTF-8?q?feat:=20=E2=9C=A8=20LabelsCollectionView?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/IssueList/LabelsCollectionView.swift | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 iOS/issue-tracker/issue-tracker/View/IssueList/LabelsCollectionView.swift diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/LabelsCollectionView.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/LabelsCollectionView.swift new file mode 100644 index 000000000..c79f3b520 --- /dev/null +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/LabelsCollectionView.swift @@ -0,0 +1,32 @@ +// +// LabelsCollectionView.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/13. +// + +import UIKit + +class LabelsCollectionView: UICollectionView { + + var labelsLayout: UICollectionViewFlowLayout = { + var layout = UICollectionViewFlowLayout() + layout.scrollDirection = .vertical + layout.estimatedItemSize = CGSize(width: 84, height: 22) + layout.minimumLineSpacing = 10 + layout.minimumInteritemSpacing = 10 + return layout + }() + + override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) { + super.init(frame: frame, collectionViewLayout: labelsLayout) + register(LabelsCollectionViewCell.self, forCellWithReuseIdentifier: LabelsCollectionViewCell.identifiers) + isScrollEnabled = false + backgroundColor = .white + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} From 75a9c7175785b8260f6909b234d80ac773ba52d6 Mon Sep 17 00:00:00 2001 From: zeke Date: Mon, 14 Jun 2021 14:02:29 +0900 Subject: [PATCH 15/16] =?UTF-8?q?feat:=20=E2=9C=A8=20LabelsCollectionView?= =?UTF-8?q?=20Cell=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LabelsCollectionViewCell.swift | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 iOS/issue-tracker/LabelsCollectionViewCell.swift diff --git a/iOS/issue-tracker/LabelsCollectionViewCell.swift b/iOS/issue-tracker/LabelsCollectionViewCell.swift new file mode 100644 index 000000000..67696e702 --- /dev/null +++ b/iOS/issue-tracker/LabelsCollectionViewCell.swift @@ -0,0 +1,43 @@ +// +// LabelsCollectionViewCell.swift +// issue-tracker +// +// Created by 양준혁 on 2021/06/13. +// + +import UIKit +import SnapKit + +class LabelsCollectionViewCell: UICollectionViewCell { + static var identifiers = "LabelsCollectionViewCell" + + let label: PaddingLabel = { + var label = PaddingLabel(withInsets: 0, 0, 10, 10) + label.textAlignment = .center + label.textColor = .white + label.layer.masksToBounds = true + label.layer.cornerRadius = 15 + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + addSubview(label) + setAutolayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + func setAutolayout() { + label.snp.makeConstraints { label in + label.edges.equalToSuperview() + } + } + + func configure(title: String, color: String) { + label.text = title + label.backgroundColor = UIColor.hexStringToUIColor(hex: color) + } +} From 46e44948da429e3d007b9d5a7c12e88eedca72bd Mon Sep 17 00:00:00 2001 From: zeke Date: Mon, 14 Jun 2021 14:02:57 +0900 Subject: [PATCH 16/16] =?UTF-8?q?chore:=20=20=F0=9F=94=A7=20IssueTableView?= =?UTF-8?q?Cell=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issue-tracker.xcodeproj/project.pbxproj | 8 ++++ .../issue-tracker/Base.lproj/Main.storyboard | 2 +- .../View/IssueList/IssueTableViewCell.swift | 43 +++++++++++++------ 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj index efcc58d3f..73669eb34 100644 --- a/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj +++ b/iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj @@ -29,6 +29,8 @@ B3B559F8266E096000901C55 /* issue_trackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B559F7266E096000901C55 /* issue_trackerTests.swift */; }; B3B55A03266E096000901C55 /* issue_trackerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B55A02266E096000901C55 /* issue_trackerUITests.swift */; }; B3EADABE2675EFED0007C4B6 /* AddLabelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */; }; + B3EADAC0267628FB0007C4B6 /* LabelsCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3EADABF267628FB0007C4B6 /* LabelsCollectionView.swift */; }; + B3EADAC2267629190007C4B6 /* LabelsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3EADAC1267629190007C4B6 /* LabelsCollectionViewCell.swift */; }; B3F527512670968F002B0812 /* LabelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527502670968F002B0812 /* LabelViewController.swift */; }; B3F527552670A0CD002B0812 /* UIColor+HexInit.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F527542670A0CD002B0812 /* UIColor+HexInit.swift */; }; B3F5275C2670C0EF002B0812 /* PaddingLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */; }; @@ -99,6 +101,8 @@ B3B55A02266E096000901C55 /* issue_trackerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = issue_trackerUITests.swift; sourceTree = ""; }; B3B55A04266E096000901C55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B3EADABD2675EFED0007C4B6 /* AddLabelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLabelButton.swift; sourceTree = ""; }; + B3EADABF267628FB0007C4B6 /* LabelsCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelsCollectionView.swift; sourceTree = ""; }; + B3EADAC1267629190007C4B6 /* LabelsCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelsCollectionViewCell.swift; sourceTree = SOURCE_ROOT; }; B3F527502670968F002B0812 /* LabelViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelViewController.swift; sourceTree = ""; }; B3F527542670A0CD002B0812 /* UIColor+HexInit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+HexInit.swift"; sourceTree = ""; }; B3F5275B2670C0EF002B0812 /* PaddingLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaddingLabel.swift; sourceTree = ""; }; @@ -163,6 +167,8 @@ B32FEAC42671DCD200BF37A1 /* IssueList */ = { isa = PBXGroup; children = ( + B3EADAC1267629190007C4B6 /* LabelsCollectionViewCell.swift */, + B3EADABF267628FB0007C4B6 /* LabelsCollectionView.swift */, B3FBA7B626730B9A0006E5E6 /* IssueToolbar.swift */, B32FEACD267260E400BF37A1 /* AddIssueButton.swift */, B32FEACB26724CF400BF37A1 /* IssueTableFooterView.swift */, @@ -562,6 +568,8 @@ D0ADB694266F0A5000E0762C /* Endpoint.swift in Sources */, B3B559E3266E095E00901C55 /* SceneDelegate.swift in Sources */, B32FEAC62671DDA600BF37A1 /* MilestoneView.swift in Sources */, + B3EADAC0267628FB0007C4B6 /* LabelsCollectionView.swift in Sources */, + B3EADAC2267629190007C4B6 /* LabelsCollectionViewCell.swift in Sources */, D0FD50AA267096C0008C6031 /* MilestoneViewController.swift in Sources */, D0FD50BB26709F8B008C6031 /* MilestoneTableViewCell.swift in Sources */, ); diff --git a/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard b/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard index 09d35b426..9ba3609d8 100644 --- a/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard +++ b/iOS/issue-tracker/issue-tracker/Base.lproj/Main.storyboard @@ -45,7 +45,7 @@ - + diff --git a/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift b/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift index 01de5834b..0788aecd0 100644 --- a/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift +++ b/iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift @@ -12,6 +12,8 @@ class IssueTableViewCell: UITableViewCell { static var identifier = "IssueTableViewCell" + var fakeData = [IssueLabel(title: "gdsfaewqeqwrqw2ewqweq", color: "#DFCD85"), IssueLabel(title: "gdsfa", color: "#DFCD85"), IssueLabel(title: "gdsfa", color: "#DFCD85"), IssueLabel(title: "gdsfaewqeqwrqw2ewqweq", color: "#DFCD85"), IssueLabel(title: "gdsfaewqeqwrqw2ewqweq", color: "#DFCD85")] + var largeTitle: UILabel = { var label = UILabel() label.font = UIFont.boldSystemFont(ofSize: 22) @@ -29,13 +31,9 @@ class IssueTableViewCell: UITableViewCell { return milestone }() - var labelView: PaddingLabel = { - var label = PaddingLabel(withInsets: 0, 0, 10, 10) - label.textAlignment = .center - label.textColor = .white - label.layer.masksToBounds = true - label.layer.cornerRadius = 15 - return label + var labelsCollectionView: LabelsCollectionView = { + var collectionView = LabelsCollectionView() + return collectionView }() var checkBoxImageView: UIImageView = { @@ -46,6 +44,7 @@ class IssueTableViewCell: UITableViewCell { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) + labelsCollectionView.dataSource = self addSubviews() setAutolayout() checkBoxImageView.isHidden = true @@ -56,7 +55,7 @@ class IssueTableViewCell: UITableViewCell { } func addSubviews() { - addSubview(labelView) + addSubview(labelsCollectionView) addSubview(labelDescription) addSubview(milestoneView) addSubview(largeTitle) @@ -82,11 +81,10 @@ class IssueTableViewCell: UITableViewCell { view.height.equalTo(22) } - labelView.snp.makeConstraints { view in + labelsCollectionView.snp.makeConstraints { view in view.top.equalTo(milestoneView.snp.bottom).offset(16) - view.leading.equalTo(16) - view.width.greaterThanOrEqualTo(30) - view.height.equalTo(30) + view.leading.trailing.equalToSuperview().inset(16) + view.bottom.equalToSuperview() } checkBoxImageView.snp.makeConstraints { image in @@ -102,8 +100,6 @@ class IssueTableViewCell: UITableViewCell { self.largeTitle.text = title self.labelDescription.text = description self.milestoneView.setMilestoneTitle(title: milestoneTitle) - self.labelView.backgroundColor = UIColor.hexStringToUIColor(hex: color) - self.labelView.text = "레이블 이름" } func check() { @@ -114,3 +110,22 @@ class IssueTableViewCell: UITableViewCell { checkBoxImageView.isHidden = true } } + +extension IssueTableViewCell: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return fakeData.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: LabelsCollectionViewCell.identifiers, for: indexPath) as? LabelsCollectionViewCell else { return UICollectionViewCell() } + cell.configure(title: fakeData[indexPath.item].title, color: fakeData[indexPath.item].color) + return cell + } + + +} + +struct IssueLabel { + var title: String + var color: String +}