Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/#176: 재치 검색 iOS UI 적용 및 리팩토링 #178

Merged
merged 37 commits into from
Feb 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
41b3858
#176: FindSearchVC iOS 버전 UI 적용
dev-muuu Feb 12, 2023
5f58306
#176: 재치 등록 두번째 프로세스 FindSearch > FindWantZatchSearch 네이밍 변경
dev-muuu Feb 13, 2023
272ebce
#176: 재치 검색 마지막 프로세스 ResultSearch > ZatchSearchResult 네이밍 변경
dev-muuu Feb 13, 2023
77df476
#171: FilterView 사이즈 재치 검색 기준으로 변경 (추후 재사용될 경우 사이즈 설정 코드 추가 예정)
dev-muuu Feb 14, 2023
59fdca7
#171: LettersAndArrowView 사이즈 재치 검색 기준으로 변경 (추후 재사용될 경우 사이즈 설정 코드 추가 예정)
dev-muuu Feb 14, 2023
069c469
#176: ExchangeMyZatchSearchView skipButton 타이틀 크기 수정
dev-muuu Feb 14, 2023
25e1e3b
#176: ZatchSearchResultView iOS 버전으로 UI 수정 및 컴포넌트 활용으로 리팩토링
dev-muuu Feb 14, 2023
b459c3f
#176: 재치 검색 결과 교환 ver. Cell iOS UI 적용
dev-muuu Feb 14, 2023
19d48cc
#176: MyZatchTableViewCell > ZatchTableViewCell 네이밍 변경 통한 재사용 준비 + UI…
dev-muuu Feb 14, 2023
478537b
#176: ZatchTableViewCellViewModel 생성 및 ZatchTableViewCell에 적용 > heart…
dev-muuu Feb 14, 2023
c4f8e49
#171: Tag configuration height25 케이스 추가
dev-muuu Feb 15, 2023
38cb8f5
#176: ZatchTableViewCell zatchStackView 프로퍼티 제거
dev-muuu Feb 15, 2023
1a5a8e1
#176: ZatchTableViewCell zatchStackView 프로퍼티 제거
dev-muuu Feb 15, 2023
4840450
#176: ZatchInformationAttach 프로토콜 생성 및 초기 구현 통한 ZatchTableViewCell 기능…
dev-muuu Feb 15, 2023
ed9cd5a
#176: ZatchTableViewCell > ZatchExchangeTableViewCell 클래스로 교환 ver 기능 확장
dev-muuu Feb 15, 2023
a184ae2
#176: ZatchTableViewCell > ZatchShareTableViewCell 클래스로 나눔 ver 기능 확장
dev-muuu Feb 15, 2023
bbfcfb1
fix: BaseViewController mainView bottom 레이아웃 safeArea > superView로 변경
dev-muuu Feb 15, 2023
df8ba54
#176: 재치 검색 하단 기준 superView > safeArea 변경
dev-muuu Feb 15, 2023
c404adf
feat: ZatchSearchResultViewController BackButton 탭할 경우 root ViewContr…
dev-muuu Feb 15, 2023
4f2fff6
#171: BaseBottomSheetViewController 타이틀 타이포 iOS 버전 적용
dev-muuu Feb 15, 2023
bed45ca
#171: Tag configuration height31 케이스 추가
dev-muuu Feb 15, 2023
14fa758
#176: 중앙 정렬 CollectionViewFlowLayout 클래스 추가
dev-muuu Feb 15, 2023
83a6d99
chore: LeftAlignCollectionViewFlowLayout 디렉토리 위치 Util - FlowLayout으로 이동
dev-muuu Feb 15, 2023
960c333
#176: SearchTagSheetViewController 리팩토링 > 자식 클래스에 있던 CollectionView 관…
dev-muuu Feb 15, 2023
c914019
#176: SearchZatchByRegister 프로토콜 선언 및 내가 찾는 재치/내가 등록한 재치에서 사용되는 셀의 프로…
dev-muuu Feb 15, 2023
c14bbb2
#176: ResultSearchTagCollectionViewCell 제거
dev-muuu Feb 15, 2023
bca25e4
#176: SearchMyZatchByRegisterCollectionViewCell SearchZatchByRegister…
dev-muuu Feb 15, 2023
2e55520
#176: SearchWantZatchByRegisterCollectionViewCell SearchZatchByRegist…
dev-muuu Feb 15, 2023
5c54d5c
#176: WantTagSearchResultCollectionViewCell 제거
dev-muuu Feb 15, 2023
851da1e
#176: MyZatchSheetViewController 리팩토링 및 collectionView 메서드는 자식 클래스에서 …
dev-muuu Feb 15, 2023
d2b9774
#176: WantZatchSheetViewController 리팩토링 및 collectionView 메서드는 자식 클래스에…
dev-muuu Feb 15, 2023
d7c32fb
#176: MyZatchSheetViewController > SearchMyRegisterZatchSheetViewCont…
dev-muuu Feb 15, 2023
3f20aaf
#176: WantZatchSheetViewController > SearchWantRegisterZatchSheetView…
dev-muuu Feb 15, 2023
b7f7221
#176: SearchZatchByRegister isSelectedState 프로퍼티 및 cell selectState에 …
dev-muuu Feb 15, 2023
0bdce87
#176: SearchMyZatchByRegisterCollectionViewCell isSelectedState 프로퍼티 …
dev-muuu Feb 15, 2023
7b3d1ee
#176: SearchWantZatchByRegisterCollectionViewCell isSelectedState 프로퍼…
dev-muuu Feb 15, 2023
ab36479
#176: SearchTagSheetViewController completion 반환 타입 Int 설정 ( > id값으로 …
dev-muuu Feb 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#176: MyZatchTableViewCell > ZatchTableViewCell 네이밍 변경 통한 재사용 준비 + UI…
… 프로퍼티 모두 private으로 접근 제어 지정
dev-muuu committed Feb 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 19d48ccd1b05702df5fe54d3ea11f6116c7cd811
Original file line number Diff line number Diff line change
@@ -6,68 +6,68 @@
//

import UIKit
import RxSwift
import RxCocoa

class MyZatchTableViewCell: BaseTableViewCell {
class ZatchTableViewCell: BaseTableViewCell, DefaultObservable {

var disposeBag = DisposeBag()
private let viewModel = ZatchTableViewCellViewModel()

// 재치 내용
let zatchImage = UIImageView().then{
private let zatchImage = UIImageView().then{
$0.backgroundColor = .systemGray6
$0.layer.cornerRadius = 4
}
let zatchStackView = UIStackView().then{
private let zatchStackView = UIStackView().then{
$0.spacing = 4
$0.axis = .vertical
$0.alignment = .leading
}
let myZatchName = UILabel().then{
private let myZatchName = UILabel().then{
$0.text = "삼다수 생수 1L"
$0.font = UIFont.pretendard(size: 17, family: .Bold)
}
let tradeImg = UIImageView().then{
private let tradeImageView = UIImageView().then{
$0.image = Image.exchangeVerticalSilver
}
let otherZatchName = UILabel().then{
private let otherZatchName = UILabel().then{
$0.text = "신라면 3봉"
$0.font = UIFont.pretendard(size: 17, family: .Bold)
}

let nicknameAndTownLabel = UILabel().then{
private let nicknameAndTownLabel = UILabel().then{
$0.text = "냥냥이 · 불광동"
$0.setTypoStyleWithSingleLine(typoStyle: .regular14_18)
}

let countInformationStackView = UIStackView().then{
private let countInformationStackView = UIStackView().then{
$0.axis = .horizontal
$0.spacing = 8
}
let heartCountView = IconAndNumberView(icon: Image.profileEmptyHeart).then{
private let heartCountView = IconAndNumberView(icon: Image.profileEmptyHeart).then{
$0.setNumber(count: 15)
}
let chatCountView = IconAndNumberView(icon: Image.profileChat).then{
private let chatCountView = IconAndNumberView(icon: Image.profileChat).then{
$0.setNumber(count: 2)
}
let borderLine = ZatchComponent.BorderLine(color: .black5, height: 1.5)
private let borderLine = ZatchComponent.BorderLine(color: .black5, height: 1.5)


// heart
lazy var heartButton = UIButton().then{
$0.setImage(Image.heartSilver, for: .selected)
private lazy var heartButton = UIButton().then{
$0.setImage(Image.heartPurple, for: .selected)
$0.setImage(Image.heartSilver, for: .normal)
}
// MARK: - LifeCycles

override func style() {
heartButton.isHidden = true
heartButton.addTarget(self, action: #selector(heartButtonDidTap), for: .touchUpInside)
//MARK: - Override

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
bind()
}

// MARK: - Actions
@objc func heartButtonDidTap() {
if heartButton.isSelected {heartButton.isSelected = false}
else {heartButton.isSelected = true}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - Functions
override func hierarchy() {

super.hierarchy()
@@ -80,7 +80,7 @@ class MyZatchTableViewCell: BaseTableViewCell {
baseView.addSubview(borderLine)

zatchStackView.addArrangedSubview(myZatchName)
zatchStackView.addArrangedSubview(tradeImg)
zatchStackView.addArrangedSubview(tradeImageView)
zatchStackView.addArrangedSubview(otherZatchName)

countInformationStackView.addArrangedSubview(heartCountView)
@@ -102,7 +102,7 @@ class MyZatchTableViewCell: BaseTableViewCell {
$0.leading.equalTo(zatchImage.snp.trailing).offset(16)
$0.trailing.equalToSuperview().inset(55)
}
tradeImg.snp.makeConstraints {
tradeImageView.snp.makeConstraints {
$0.width.height.equalTo(20)
$0.leading.equalToSuperview()
}
@@ -134,7 +134,7 @@ class MyZatchTableViewCell: BaseTableViewCell {
}
}

extension MyZatchTableViewCell{
extension ZatchTableViewCell{

class IconAndNumberView: UIStackView{
private let iconImage = UIImageView()
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ extension ZatchViewController {
heartZatchTableView = UITableView().then{
$0.delegate = self
$0.dataSource = self
$0.register(MyZatchTableViewCell.self, forCellReuseIdentifier: "MyZatchTableViewCell")
$0.register(ZatchTableViewCell.self, forCellReuseIdentifier: "MyZatchTableViewCell")

// autoHeight
$0.rowHeight = UITableView.automaticDimension
@@ -42,8 +42,7 @@ extension ZatchViewController: UITableViewDelegate, UITableViewDataSource {
return 10
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "MyZatchTableViewCell", for: indexPath) as? MyZatchTableViewCell else { return UITableViewCell() }
cell.addHeartToCell(color: "purple")
guard let cell = tableView.dequeueReusableCell(withIdentifier: "MyZatchTableViewCell", for: indexPath) as? ZatchTableViewCell else { return UITableViewCell() }
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ extension MyZatchTabViewController: UITableViewDataSource, UITableViewDelegate{
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(for: indexPath, cellType: MyZatchTableViewCell.self)
let cell = tableView.dequeueReusableCell(for: indexPath, cellType: ZatchTableViewCell.self)
return cell
}

Original file line number Diff line number Diff line change
@@ -135,8 +135,7 @@ extension ZatchSearchResultViewController: UITableViewDelegate, UITableViewDataS
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(for: indexPath, cellType: MyZatchTableViewCell.self)
cell.addHeartToCell(color: "yellow")
let cell = tableView.dequeueReusableCell(for: indexPath, cellType: ZatchTableViewCell.self)
return cell
}

2 changes: 1 addition & 1 deletion Zatch/Presentation/Views/MyZatch/MyZatchView.swift
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ class MyZatchView: BaseView{
$0.setTitle("전체보기")
}
let zatchTableView = UITableView().then{
$0.register(cellType: MyZatchTableViewCell.self)
$0.register(cellType: ZatchTableViewCell.self)
}
lazy var floatingButton = UIButton().then{
$0.backgroundColor = .zatchPurple
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ class MyProfileView: UIView {
$0.delegate = dataSourceDelegate
$0.dataSource = dataSourceDelegate
$0.register(ProfileTableViewCell.self, forCellReuseIdentifier: "ProfileTableViewCell")
$0.register(MyZatchTableViewCell.self, forCellReuseIdentifier: "MyZatchTableViewCell")
$0.register(ZatchTableViewCell.self, forCellReuseIdentifier: "MyZatchTableViewCell")

// autoHeight
$0.rowHeight = UITableView.automaticDimension
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ class ZatchSearchResultView: BaseView {


let tableView = UITableView().then{
$0.register(cellType: MyZatchTableViewCell.self)
$0.register(cellType: ZatchTableViewCell.self)
}

let emptyResultView = ResultEmptyTableViewCell().then{