Chore/#143 Design QA(ticket + Reservation)#146
Conversation
wngus4296
left a comment
There was a problem hiding this comment.
μ©μ¬!! μκ°λ³΄λ€ 체ν¬ν κ² λ§μμ νλ€μμν
λ° μμ νλλΌ κ³ μλ§μμ΄~~!!
μ½λ©νΈ νμΈλΆνν΄ π«
| let index = BankEntity.all.firstIndex { $0 == selectedBank } | ||
| guard let index else { return } |
There was a problem hiding this comment.
μκΈ°λ μ΄λ κ² μ μ΄λ³΄λ 건 μ΄λ¨κΉ?!
| let index = BankEntity.all.firstIndex { $0 == selectedBank } | |
| guard let index else { return } | |
| guard let index = BankEntity.all.firstIndex(where: { $0 == selectedBank }) else { return } |
There was a problem hiding this comment.
μ€μ€ μλ ννμμλ νΈλ μΌλ§ ν΄λ‘μ Έλ₯Ό μ¨μ λ°λ‘ μ΅μ λ λ°μΈλ© μλλλΌκ΅¬! κ·Έλ₯ μμ°κ³ μμ±νλ©΄ λλꡬλ! κ³ λ§μ€ μ£ΌνπββοΈ
| var selectedItemIndex: Int? | ||
| var selectedItem: ((BankEntity?) -> ())? | ||
|
|
||
| // viewModelλ‘ μ€μ ν μμ |
There was a problem hiding this comment.
μ λ·°λͺ¨λΈμ λ§λ€κΉ λ§κΉ κ³ λ―Όν λ μ¨ λμ 건λ°! λ΄κ° μ 리νλ €κ΅¬ μ¨λ¨μ΄!~ pushν λλ μ κ±°ν 겑π
| if let index = owner.selectedItemIndex { | ||
| owner.selectedItem?(BankEntity.all[index]) | ||
| } else { | ||
| owner.selectedItem?(nil) | ||
| } |
There was a problem hiding this comment.
νμ¬ μν μ ν λ·°μμ cellμ λ λ² λλ μ λ isSelectedκ° ν리λ λ°©μμ΄ μλκΈ° λλ¬Έμ
μ¬κΈ° selectedItemIndexκ° μλ κ²½μ° nilμ λ€μ 보λ΄μ£Όμ§ μμλ λ κ² κ°μ!
| if let index = owner.selectedItemIndex { | |
| owner.selectedItem?(BankEntity.all[index]) | |
| } else { | |
| owner.selectedItem?(nil) | |
| } | |
| guard let index = owner.selectedItemIndex else { return } | |
| owner.selectedItem?(BankEntity.all[index]) |
There was a problem hiding this comment.
μ μ!! μκ°ν΄λ³΄λκΉ μ΄μ°¨νΌ ν΄λ‘μ Έμ input κ°μ μ λ£μ΄μ£Όλ©΄ μ€νμλλκΉ κ΅³μ΄ Optionalλ‘ μ²λ¦¬νμ§ μμλ λ κ±°κ°μμ μ½λ λ°κΏ¨μ€!! λ‘ν μ£Όνπ
| private let blankSpaceView: UIView = { | ||
| let view = UIView() | ||
| return view | ||
| }() | ||
|
|
There was a problem hiding this comment.
μ΄κ±° μ·¨μ/νλΆκ·μ - νλΆ μμ²νκΈ° μ¬μ΄ blank λλ¬Έμ λ£μλ κ±° κ°μλ° μ§κΈ νλΆ μμ²νκΈ° λ²νΌ μλμ λ€μ΄κ°κ³ μλλΌκ΅¬..!
214λ² μ€ <-> 215λ² μ€ μ΄λ κ² λ³κ²½ν΄λ λꡬ
μλλ©΄ blankViewλ₯Ό μμ νκ³ μλ μ½λλ₯Ό λ£μ΄μ€λ λ κ±° κ°μ!
self.contentStackView.setCustomSpacing(40, after: self.reversalPolicyView)κ·Έλ¦¬κ³ μΆκ°λ‘ 33λ²μ€μ νμ¬ μ΄λ κ² λ£μ΄μ Έμλλ°
private lazy var contentStackView: UIStackView = {
let stackView = UIStackView()
stackView.axis = .vertical
stackView.distribution = .fill
stackView.alignment = .center
stackView.spacing = 12
stackView.setCustomSpacing(0, after: self.concertInformationView) // μ¬κΈ° μ λλ‘ μλ μλ¨!
return stackView
}()μμ§ addArrangedSubViewsκ° λμ§ μμ μν©μ΄λΌ μ£Όμ λ¬μλμ λΆλΆμ΄ μλμ΄ μλλ μ€λ₯κ° μμ΄μ
- lazy var -> letμΌλ‘ λ³κ²½ν΄μ£Όκ³
- addArrangedSubViewsν¨μμ μλ μ½λ λ£μ΄μ£ΌκΈ°
λ‘ μμ νλ©΄ μ μλνλ κ±° κ°μ~!!
self.contentStackView.setCustomSpacing(0, after: self.concertInformationView)
self.contentStackView.setCustomSpacing(40, after: self.reversalPolicyView)There was a problem hiding this comment.
μ£Όν! setCumstomSpacingμ 맨 λ§μ§λ§ viewμλν΄μλ spacingμ λͺ» λ£μ΄μ£Όλ κ±° κ°λλΌκ΅¬?! κ·Έλμ μΌλΆλ‘ blankViewλ₯Ό ꡬννμ€! (κ³΅μ° μλ§€ λ§κ° μΌμ λ°λΌμ buttonμ΄ hiddenμ²λ¦¬κ° λ λκ° μμ΄μ)
νΉμ λ μ’μ λ°©λ²μ΄ μμκΉ?!
There was a problem hiding this comment.
μ λ²νΌ hidden μ²λ¦¬ λλ¬Έμ΄μꡬλ!!
configureRefundButton ν¨μ μμμ νλΆνκΈ° λ²νΌ μ¨κΉ μ²λ¦¬μ λ°λΌ stackviewμ insetμ μ£Όλ λ°©λ²μ΄ μμ κ² κ°κΈ΄νλ° ..
λκ° λ μ’μ λ°©λ²μΌμ§λ κ³ λ―Όμ΄λλ€ ..!
μ©μ¬κ° λ³΄κ³ λ νΈν μͺ½μΌλ‘ κ°λ κ² μ’μ λ―!!
private func configureRefundButton(with entity: TicketReservationDetailEntity) {
switch entity.reservationStatus {
case .reservationCompleted:
if Date() <= entity.salesEndTime.formatToDate() {
self.requestRefundButton.isHidden = false
} else {
self.requestRefundButton.isHidden = true
}
default:
self.requestRefundButton.isHidden = true
}
// μ¬κΈ°!! addArrangedSubViewsν¨μ μμμνλ©΄ hidden κ°μ λͺ»κ°μ Έμ€λ μ΄μκ° μμ ..!!
if self.requestRefundButton.isHidden {
self.contentStackView.isLayoutMarginsRelativeArrangement = true
self.contentStackView.directionalLayoutMargins = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 40, trailing: 0)
} else {
self.contentStackView.setCustomSpacing(40, after: self.reversalPolicyView)
}
}μ 그리ꡬ concertInformationView μμ spacing λΊ λμ΄λ₯Ό heightμΌλ‘ μ§μ ν΄μ€¬λλΌκ΅¬!
κ·Έλμ μλ μ½λλ λΉΌλ λ λ―!!
self.contentStackView.setCustomSpacing(0, after: self.concertInformationView)- QR μ½λ κ΄λ ¨ 리뷰 μ½λ©νΈ λ°μ
μμ ν λ΄μ©
(μ€κ°μ Developμ λ¨Έμ§νλλ°, λ³κ²½λ νμΌμ΄ νμ¬ develop μ΄μ λ²μ κ³Ό λΉκ΅ν΄μ 체νΉμ νλ κ±° κ°μμ!.. κ·Έλμ λ³κ²½λ νμΌ λ³΄κΈ° μ« νλ€ κ±° κ°μλ°.. νΉμ λ¬Έμ κ° μμΌλ©΄ μλ €μ£Όμλ©΄ λ°λ‘ λ¬λ €κ°κ² μλλ€!!..)
μ€ν¬λ¦°μ·
κ΄λ ¨ μ΄μ