-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2723910
[Feat/#38] SignUp init
FpRaArNkK 78a49dd
[Feat/#38] UserUseCase, SignUpValidate 작성
FpRaArNkK c8b921c
[Feat/#38] UIViewController KeyboardDismiss 로직 작성
FpRaArNkK f8a94aa
[Feat/#38] 텍스트필드 컴포넌트 위치 변경, 로직 수정
FpRaArNkK e9a944c
[Chore/#38] AppThemeButton State -> isEnabled 로 변경
FpRaArNkK 1e5f3f5
[Feat/#38] SignUp 화면 작성
FpRaArNkK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,18 @@ | ||
// | ||
// UserUseCase.swift | ||
// Noostak_iOS | ||
// | ||
// Created by 박민서 on 2/20/25. | ||
// | ||
|
||
import RxSwift | ||
|
||
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)) | ||
} | ||
} | ||
27 changes: 27 additions & 0 deletions
27
Noostak_iOS/Noostak_iOS/Domain/UseCase/Validator/SignUpValidator.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,27 @@ | ||
// | ||
// SignUpValidator.swift | ||
// Noostak_iOS | ||
// | ||
// Created by 박민서 on 2/20/25. | ||
// | ||
|
||
import Foundation | ||
|
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 오호 이렇게 해도 좋겠네요! 👍👍👍 |
||
return .invalid(reason: "이름은 1~10자로 입력해야 합니다.") | ||
} | ||
|
||
// 2. 허용 문자: 영어 대소문자, 숫자, 한글, 홀자(한자) | ||
let regex = "^[A-Za-z0-9가-힣]*$" | ||
let predicate = NSPredicate(format: "SELF MATCHES %@", regex) | ||
|
||
if !predicate.evaluate(with: name) { | ||
return .invalid(reason: "띄어쓰기 및 특수문자는 사용할 수 없습니다.") | ||
} | ||
|
||
return .valid | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Noostak_iOS/Noostak_iOS/Domain/UseCase/Validator/ValidationResult.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,12 @@ | ||
// | ||
// ValidationResult.swift | ||
// Noostak_iOS | ||
// | ||
// Created by 박민서 on 2/20/25. | ||
// | ||
|
||
|
||
enum ValidationResult { | ||
case valid | ||
case invalid(reason: String) | ||
} |
150 changes: 0 additions & 150 deletions
150
Noostak_iOS/Noostak_iOS/Global/Components/AppColorTextField.swift
This file was deleted.
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
이게 뭔가요?