-
Notifications
You must be signed in to change notification settings - Fork 26
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
AI 챗봇 앱 [Step3] Hoi, Andy #51
Open
happykwon
wants to merge
26
commits into
tasty-code:d_Hoi
Choose a base branch
from
andyanappdev:main
base: d_Hoi
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
CustomCel구현을 위해 MessageContent별 로직을 구현한 UIStackView 구현
채팅화면 구현을 위한 CustomCell 구현 및 autolayout적용
가변적인 cell높이를 구현하기 위해 UICollectionViewFlowLayout 적용
명세서대로 ViewController 구현을 위해 API통신 TEST용 코드 삭제
유저 input section 부분 구현 및 autolayout적용
notification을 활용해서 키보드 호출에 따른 동적 View움직임 구현
setupStackView메서드 내 textView Autolayout관련 코드 삭제 자동적으로 textView의 크기가 적용 될 수 있게 수정
메시지 길이가 길어지는 것을 대비, 동적 높이 구현을 위한 로직 추가
CollectionView 셀구성 및 데이터 맵핑을 위한 프로토콜 구현
MessageRepository 객채 delegate 패턴 구현 구성
height를 동적으로 구하는 로직은 추후 추가 예정
StackViewDoneButton 누를 시 API통신 구현 완료 및 테스트 완료
scrollToButtom: 채팅에러처리를 위한 Alert구현, 최신 메시지 스크롤 로직 구현
동작 로직에 상관없는 코드 삭제
…FlowLayout 리팩토링 greatestFiniteMagnitude를 사용해 height 길이 설정 및 boundingRect메서드를 사용해 높이 구함
autolayout충돌 로그를 확인하고 CGSize_height 값 조정
수정사항: viewModel내 UI구현 로직(dispatchQueue)삭제, viewController에 추가
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
안녕하세요 그린 @GREENOVER , 만나서 반갑습니다! 😆
AI챗봇애 STEP3 PR 드립니다.
Autolayout의 매운맛을 제대로 느껴본 과정이였습니다..
계속 에러가 나서 많이 늦어졌네요 🤣
🔍 What is this PR?
Step3
구현사항
PR Point
UICollectionViewDelegateFlowLayout사용
셀 높이의 동적인 변화가 필요하기 때문에 UICollectionViewDelegateFlowLayout를 사용해 셀의 크기를 동적으로 계산하도록 했습니다.
notification을 활용한 keyboard 대응 동적 view 구현
UIResponder.keyboardFrameEndUserInfoKey
를 통해 키보드의 크기에 대한 CGRect값을 얻어 키보드가 올라온다면 height값만큼 view를 올려주도록 했고,self.view.transform = .identity
를 사용해 keyboard가 사라지면 원래의 값으로 돌아오게 구현했습니다.❓질문
1. GCD를 적절하게 사용하였는지
UI를 구현하는 코드는 mainThraed에서 작동하게 신경써서 구현했습니다. 혹시 빠진 부분이나 global에서 작동되어야 할 코드들이 있다면 조언 부탁드립니다 !
2. MVVM 모델 설계
역할을 분리해주려고 노력했지만... viewController에서 많은 것들이 처리되는 것 같습니다. viewModel이 너무 하는 일이 없는 것 같은데 혹시나 그린이 보기에 역할 구분이 잘 되지 않은 부분이 있다면 조언 부탁드립니다 !
3. Autolayout
Autolayout을 전부 구현하고 확인해보니 에러가 계속 떠서 어디서부터 잘못된 것인지 디버깅 하는데 갈피를 못잡았습니다.
현업에서 UI구성 시 이러한 사태를 방지하기 위해 어떤식으로 구현을 하는지 아니면, 그린만의 노하우가 있는지 궁금합니다.