-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feat] #279 - 디자인 시스템 GBStackView구현 #280
[Feat] #279 - 디자인 시스템 GBStackView구현 #280
Conversation
|
||
final class GBStackView: UIStackView { | ||
|
||
init(type: GBStackType, data: [Bool]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p2;
음 .. 일단 클래스 내용 자체는 잘 돌아갈 것 같은데
입력값 네이밍이 적절하지 않다고 생각합니닷
클래스 선언할 때 data: [false, true, false]
이런 식이라면 거짓, 참, 거짓
이라는 데이터가 들어가는걸로 이해가 돼서요..!!
아마 서버에서 데이터 내려줄 때 bool 타입 배열로 내려줘서 이렇게 한 것 같은데,
차라리 bool 타입 입력값을 hasHaccpMark
, hasVeganMark
, hasGMOMark
이렇게 3가지 입력값을 따로따로 받고
init 에서 아래처럼 하면 어떨까요 ??
init() {
super.init(frame: .zero)
setUI()
if hasHaccpMark { addMark(.haccp) }
if hasVeganMark { addMark(.vegan) }
if hasGMOMark { addMark(.gmo) }
}
요런 느낌쓰..??
제안일 뿐입니다..! 다른 방법 생각나는거 있으면 그걸로 해주셔요 !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var images: [UIImage] {
switch self {
case .big: return [.haccpMark28px, .veganMark28px, .gmoMark28px]
case .small: return [.haccpMark22px, .veganMark22px, .gmoMark22px]
}
}
이 부분 대신
// GBStackType.swift
var haccpMark: UIImage {
switch self {
case .big: return .haccpMark28px
case .small: return .haccpMark22px
}
}
var veganMark: UIImage {
switch self {
case .big: return .veganMark28px
case .small: return .veganMark22px
}
}
// ...
// GBStackView.swift
// ...
init(type: GBStackType, isHaccp: Bool, isVegan: Bool, isNonGMO: Bool) {
// ...
if isHaccp { addHaccpMark() }
if isVegan { addVeganMark() }
if isNonGMO { addNonGMOMark() }
}
// ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네! 매개변수명 코리 반영했습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인확인 ~~
🌁 Background
📱 Screenshot
👩💻 Contents
✅ Testing
📝 Review Note
📣 Related Issue
📬 Reference