-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iOS/feature/#27/IssueList'
Conflicts: iOS/issue-tracker/issue-tracker.xcodeproj/project.pbxproj
Showing
17 changed files
with
764 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
41 changes: 41 additions & 0 deletions
41
iOS/issue-tracker/issue-tracker/Controller/IssueTableFooterView.swift
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,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) | ||
} | ||
} | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
iOS/issue-tracker/issue-tracker/Controller/IssueToolbar.swift
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,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 | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
iOS/issue-tracker/issue-tracker/View/IssueList/AddIssueButton.swift
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,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 | ||
|
||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
iOS/issue-tracker/issue-tracker/View/IssueList/CancelButton.swift
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,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") | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
iOS/issue-tracker/issue-tracker/View/IssueList/FilterBarButton.swift
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,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") | ||
} | ||
} |
131 changes: 131 additions & 0 deletions
131
iOS/issue-tracker/issue-tracker/View/IssueList/IssueTableViewCell.swift
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,131 @@ | ||
// | ||
// LabelTableViewCell.swift | ||
// issue-tracker | ||
// | ||
// Created by 양준혁 on 2021/06/09. | ||
// | ||
|
||
import UIKit | ||
import SnapKit | ||
|
||
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) | ||
return label | ||
}() | ||
|
||
var labelDescription: UILabel = { | ||
var label = UILabel() | ||
label.textColor = .lightGray | ||
return label | ||
}() | ||
|
||
var milestoneView: MilestoneView = { | ||
var milestone = MilestoneView() | ||
return milestone | ||
}() | ||
|
||
var labelsCollectionView: LabelsCollectionView = { | ||
var collectionView = LabelsCollectionView() | ||
return collectionView | ||
}() | ||
|
||
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) | ||
labelsCollectionView.dataSource = self | ||
addSubviews() | ||
setAutolayout() | ||
checkBoxImageView.isHidden = true | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
func addSubviews() { | ||
addSubview(labelsCollectionView) | ||
addSubview(labelDescription) | ||
addSubview(milestoneView) | ||
addSubview(largeTitle) | ||
addSubview(checkBoxImageView) | ||
} | ||
|
||
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) | ||
} | ||
|
||
labelsCollectionView.snp.makeConstraints { view in | ||
view.top.equalTo(milestoneView.snp.bottom).offset(16) | ||
view.leading.trailing.equalToSuperview().inset(16) | ||
view.bottom.equalToSuperview() | ||
} | ||
|
||
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) { | ||
self.largeTitle.text = title | ||
self.labelDescription.text = description | ||
self.milestoneView.setMilestoneTitle(title: milestoneTitle) | ||
} | ||
|
||
func check() { | ||
checkBoxImageView.isHidden = false | ||
} | ||
|
||
func uncheck() { | ||
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 | ||
} |
32 changes: 32 additions & 0 deletions
32
iOS/issue-tracker/issue-tracker/View/IssueList/LabelsCollectionView.swift
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 @@ | ||
// | ||
// 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") | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
iOS/issue-tracker/issue-tracker/View/IssueList/MilestoneView.swift
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,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 | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
iOS/issue-tracker/issue-tracker/View/IssueList/SelectBarButton.swift
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,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") | ||
} | ||
} |
137 changes: 137 additions & 0 deletions
137
iOS/issue-tracker/issue-tracker/View/IssueListViewController.swift
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,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]) | ||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
iOS/issue-tracker/issue-tracker/View/Label/AddButton.swift
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
iOS/issue-tracker/issue-tracker/View/Label/AddLabelButton.swift
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,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") | ||
} | ||
} |
65 changes: 0 additions & 65 deletions
65
iOS/issue-tracker/issue-tracker/View/Label/LabelTabelHeaderView.swift
This file was deleted.
Oops, something went wrong.