-
Notifications
You must be signed in to change notification settings - Fork 2
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] 온보딩 프로세스 구현완료 #156
[feat] 온보딩 프로세스 구현완료 #156
Conversation
mvvm + 옵저버블 채택하여 구현 정규식, 조건따라 보더색상 변경 키보드 커스텀
프로필 UI 구현 완료 각 버튼 깡통버튼인 상태 default 프로필 png 등록시 이미지가 깨지길래 svg로 삽입
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.
고생하셨습니다!!
<key>NSPhotoLibraryAddUsageDescription</key> | ||
<string>정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!</string> | ||
<key>NSCameraUsageDescription</key> | ||
<string>정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!정혜진!</string> |
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.
아 이부분 기획자 선생님들꼐 말을 해서 정확한 정보로 수정 예정입니다! 다음 스크럼때 말하겟습니다!
let navigationBar = UIView().then { | ||
$0.backgroundColor = .white | ||
} | ||
|
||
let titleLabel = UILabel().then { | ||
$0.setText("프로필 설정", style: .body03, color: .black) | ||
} | ||
|
||
let separatorLine = UIView().then { | ||
$0.backgroundColor = .gray2 | ||
} |
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.
시스템이 기본 제공하는 navigationItem을 사용하지 않으시고, 직접 view를 이용하여 구현하셨네요!
혹시 하단의 경계선 때문일까요?
그리고 UIView(backgroundColor: .white)
로 생성도 가능하답니다.
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.
시스템이 기본 제공하는 navigationItem을 사용하지 않으시고, 직접 view를 이용하여 구현하셨네요!
혹시 하단의 경계선 때문일까요?
-> 넵 맞습니다! 온보딩 프로세스에는 네비게이션이 들어가있지 않아서 해당 프로세스에는 커스텀으로 구현해서 넣었습니다
override func setupAutoLayout() { | ||
navigationBar.snp.makeConstraints { | ||
$0.top.leading.trailing.equalToSuperview() | ||
$0.height.equalTo(92) |
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.
Screen!
override func setupView() { | ||
backgroundColor = .white | ||
|
||
[navigationBar, separatorLine, subtitleLabel, nicknameTextField, errorLabel, nextButton].forEach { addSubview($0) } |
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.
addSubviews(_ views: UIView...)
라는 메서드를 만들어 두긴 했습니다..ㅎ
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.
코딩 습관이 무섭네요 바로 코드 수정하겟습니다!
private func setupActions() { | ||
nicknameView.nicknameTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged) | ||
nicknameView.nextButton.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside) | ||
} |
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.
BaseViewController로부터 오버라이딩이 가능한 setupAction
메서드가 있으니 해당 메서드로 작성해도 괜찮을 것 같아요!
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 name.isEmpty { | ||
nicknameState.value = .empty | ||
errorMessage.value = nil | ||
isNextButtonEnabled.value = false | ||
} else if name.range(of: nicknameRegex, options: .regularExpression) != nil { | ||
nicknameState.value = .valid | ||
errorMessage.value = nil | ||
isNextButtonEnabled.value = true | ||
} else { | ||
nicknameState.value = .invalid | ||
errorMessage.value = "한글, 영문, 숫자만을 사용해 총 5자 이내로 입력해주세요." | ||
isNextButtonEnabled.value = false | ||
} |
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.
캬 이지훈 이 멋진녀석
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
setupBindings() | ||
setupAction() |
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.
setupAction
은 viewDidLoad
에서 호출하지 않아도 됩니다.
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.
일단 다 떄려박고 시작하는데 습관좀 고치겟습니다!!!!
@objc private func confirmButtonTapped() { | ||
let welcomeVC = WelcomeViewController(viewModel: WelcomeViewModel(nickname: viewModel.nickname)) | ||
welcomeVC.modalPresentationStyle = .fullScreen | ||
present(welcomeVC, animated: true, completion: nil) | ||
} | ||
|
||
@objc private func skipButtonTapped() { | ||
let welcomeVC = WelcomeViewController(viewModel: WelcomeViewModel(nickname: viewModel.nickname)) | ||
welcomeVC.modalPresentationStyle = .fullScreen | ||
present(welcomeVC, animated: true, completion: nil) | ||
} |
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.
어엇 위에 주석으로 처리하고 코드 원문 보면서 코드를 수정하고 삭제를 햇어야하는데 코드를 복붙을 해버렷네요 앞으로 졸면서 코딩하지 않겟습니다!!
@objc private func cameraButtonTapped() { | ||
let imagePicker = UIImagePickerController() | ||
imagePicker.delegate = self | ||
imagePicker.sourceType = .photoLibrary | ||
imagePicker.allowsEditing = true | ||
present(imagePicker, animated: true) | ||
} | ||
|
||
private func cropToCircle(image: UIImage) -> UIImage { | ||
let shorterSide = min(image.size.width, image.size.height) | ||
let imageBounds = CGRect(x: 0, y: 0, width: shorterSide, height: shorterSide) | ||
UIGraphicsBeginImageContextWithOptions(imageBounds.size, false, UIScreen.main.scale) | ||
let context = UIGraphicsGetCurrentContext()! | ||
context.addEllipse(in: imageBounds) | ||
context.clip() | ||
image.draw(in: imageBounds) | ||
let circleImage = UIGraphicsGetImageFromCurrentImageContext()! | ||
UIGraphicsEndImageContext() | ||
return circleImage | ||
} |
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.
UIGraphicsGetImageFromCurrentImageContext
함수가 현재 그래픽 컨텍스트에 그려진 이미지를 UIImage로 반환해서 가져오는 역할을 합니다. 이로인해 이미지가 반환이 되지 않는다면 프로필 등록 자체가 되지 않기 때문에 강제 언래핑을 넣었습니다.
하지만 생각해보니 이미지 등록에 실패한 에러처리가 있는것도 아니기 떄문에 강제 언래핑은 지양해야하는것이 맞는것같네요 해당부분 수정하겟습니다.
$0.setTitle("지금은 넘어가기", for: .normal) | ||
$0.setTitleColor(.gray5, for: .normal) | ||
$0.titleLabel?.font = UIFont.pretendard(.body05) |
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.
setTitle(title, style, color)
를 만들어 두었습니다.
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.
다음 코드리뷰부터 기본으로 만들어놓은 메서드 사용하지 않는일 없도록 진행하겟습니다
…into feat/#154-onboarding
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.
수고많으셨습니당! ViewModel 참고하겠습니다 ,,ㅎㅎ
🔗 연결된 이슈
📄 작업 내용
RPReplay_Final1720623788.MP4
📚 참고자료
👀 기타 더 이야기해볼 점
이후 한번에 반응형 Screen으로 수정할 예정입니다