-
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/NST-10] #38 회원가입 화면 작성 #39
Conversation
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.
👍🏻👍🏻👍🏻👍🏻👍🏻
protocol UserUseCaseProtocol { | ||
func validate(name: String) -> Observable<ValidationResult> | ||
} | ||
|
||
final class UserUseCase: UserUseCaseProtocol { | ||
func validate(name: String) -> Observable<ValidationResult> { | ||
return Observable.just(SignUpValidator.validate(name: name)) | ||
} | ||
} |
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.
이게 뭔가요?
struct SignUpValidator { | ||
static func validate(name: String) -> ValidationResult { | ||
// 1. 글자 수 제한 (1~10자) | ||
guard (1...10).contains(name.count) else { |
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.
저는 범위연산자 사용하는데 이렇게도 할 수 있군요?
1...10 ~= name.count
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.
오호 이렇게 해도 좋겠네요! 👍👍👍
if let placeholder { | ||
textField.setPlaceholder( | ||
text: placeholder, | ||
color: .appGray600, | ||
font: .PretendardStyle.b5_r.font | ||
) | ||
} | ||
if let countLimit { setCountLabelBinding(limit: countLimit) } | ||
if activateDeleteButton { setDeleteButton() } |
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.
init 부분에서 각 입력값에 따라 UI 세팅이 될 수 있도록 작성했습니다!
각 세팅 내용을 함수로 나누고, init에서 하나씩 작성하여 init 때 해당 내용이 해당 조건에 실행됨을 명확히 하기위해 작성했습니다
🔥 Issue
#38
🔥 변경된 내용
🔥 PR Point
기존 텍스트 사용 방법은 변함 없으나, Rx를 통한 state와 deleteButtonTap 사용에서 일부 변화가 있습니다
사용법은 아래와 같습니다.
🔥 ScreenShot
🔥 Reference