-
Notifications
You must be signed in to change notification settings - Fork 26
AI 챗봇 앱 [STEP 3] Paul & Kyle #50
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
Open
Changhyun-Kyle
wants to merge
39
commits into
tasty-code:d_Kyle
Choose a base branch
from
Changhyun-Kyle:develop
base: d_Kyle
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
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
2ab507a
feat: ChatBubbleView 구현
earths-voluble 916816b
feat: MessageView 구현
earths-voluble 48aa667
feat: ChatBubbleView 및 MessageView 구현
earths-voluble e21c6ef
add: CollectionView 구성 파일 추가
Changhyun-Kyle 76d7e69
refine: MockData 파싱으로 변경
Changhyun-Kyle 672954f
feat: 채팅 리스트 구현
Changhyun-Kyle 2234a2a
Merge branch 'develop' into Step3
Changhyun-Kyle 7ea3c9a
Merge pull request #4 from Changhyun-Kyle/Step3
Changhyun-Kyle 1b08502
chore: MockData 추가
Changhyun-Kyle 2f41b50
chore: MockData 반영 로직 추가
Changhyun-Kyle f48bd66
chore: isHidden 추가
Changhyun-Kyle ad47d2d
feat: 자동 스크롤 기능 구현
Changhyun-Kyle 02c23c0
feat: UICollectionView 구분선 제거 및 선택 효과 삭제
Changhyun-Kyle 6e7b29b
fix: 메세지 뷰 버그 수정
Changhyun-Kyle 5430115
feat: ChatInputView 구현
earths-voluble ef9b4f3
feat: ChatInputView 오토 레이아웃 추가
earths-voluble 2389e00
chore: ChatSendButton -> ChatInputSendButton으로 네이밍 변경
earths-voluble b353ade
chore: UITextViewDelegate 수정
earths-voluble 11c4a23
feat: 소프트웨어 키보드 표시 시 레이아웃 수정
earths-voluble eec2041
feat: 화면 터치 시 키보드 숨김 기능 추가
earths-voluble 22621e7
refine: 실제 네트워크 통신 로직으로 변경
Changhyun-Kyle 0055729
feat: requestDTO 추가
Changhyun-Kyle 193ac2a
feat: 메세지 버블 뷰 기능 구현
Changhyun-Kyle 513a18d
feat: RequestDTO 구현
Changhyun-Kyle 35fbc11
refine: 메세지 버블 뷰 수정
Changhyun-Kyle a9e6f8a
chore: 코드 컨벤션에 맞게 수정
Changhyun-Kyle 63bb864
refactor: 키보드 관련 이벤트 메서드 분리
Changhyun-Kyle 94d547c
chore: 불필요 Delegate 삭제
Changhyun-Kyle 2362a16
refine: 메세지 버블 뷰 수정
Changhyun-Kyle 5c47291
refactor: 키보드 관련 이벤트 메서드 분리
Changhyun-Kyle f8f76bf
chore: 불필요 주석 제거
Changhyun-Kyle 7fd3fc4
fix: Request Body 생성 오류 수정
Changhyun-Kyle e662dd2
Merge pull request #6 from Changhyun-Kyle/Step3
Changhyun-Kyle 914b98c
refactor: ChattingView 구현 후 ViewController 로직 분기
Changhyun-Kyle f5b8308
refine: ChatBubbleMakable 생성 및 MessageView 네이밍 변경
Changhyun-Kyle 9995476
chore: extension 구현부 수정
Changhyun-Kyle 0fa8156
refactor: ChatBubbleMakable 프로토콜 구현 및 분기 처리
Changhyun-Kyle fe71b9d
chore: MessageView 네이밍 수정
Changhyun-Kyle fe7de10
fix: prepareReuse를 활용한 메세지 뷰 버그 수정
Changhyun-Kyle 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 hidden or 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 hidden or 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 hidden or 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,61 @@ | ||
| // | ||
| // UIViewController+.swift | ||
| // ChatBot | ||
| // | ||
| // Created by 강창현 on 4/14/24. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| extension UIViewController { | ||
| func setupKeyboardNotification() { | ||
| NotificationCenter.default.addObserver( | ||
| self, | ||
| selector: #selector(self.keyboardWillShow), | ||
| name: UIResponder.keyboardWillShowNotification, | ||
| object: nil | ||
| ) | ||
| NotificationCenter.default.addObserver( | ||
| self, | ||
| selector: #selector(self.keyboardWillHide), | ||
| name: UIResponder.keyboardWillHideNotification, | ||
| object: nil | ||
| ) | ||
| addKeyboardGesture() | ||
| } | ||
|
|
||
| private func addKeyboardGesture() { | ||
| let tapGestureRecognizer = UITapGestureRecognizer( | ||
| target: self, | ||
| action: #selector(dismissKeyboard) | ||
| ) | ||
| view.addGestureRecognizer(tapGestureRecognizer) | ||
| } | ||
|
|
||
| @objc | ||
| private func dismissKeyboard() { | ||
| view.endEditing(true) | ||
| } | ||
|
|
||
| @objc | ||
| private func keyboardWillShow(notification: NSNotification) { | ||
| guard | ||
| let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue | ||
| else { | ||
| return | ||
| } | ||
|
|
||
| self.view.frame.size.height -= keyboardSize.height | ||
| } | ||
|
|
||
| @objc | ||
| private func keyboardWillHide(notification: NSNotification) { | ||
| guard | ||
| let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue | ||
| else { | ||
| return | ||
| } | ||
|
|
||
| self.view.frame.size.height += keyboardSize.height | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
보통 키보드 레이아웃 조절 시 view의 frame 자체를 움직이기 보단, scrollView의 contentInset을 조절해서 레이아웃을 구현하는 것이 좋습니다.
view의 frame 자체 직접 조절하게 되면, autolayout이 깨질 수 있고, 여러분들이 질문주신 것 처럼, 예상치 못한 UI와 관련된 문제들이 발생할 수 있습니다.
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.
현재
ChattingView(UIView)안에CollectionView와ChatInputView가add되어 있습니다.contentInset을 활용하기 위해선UIScrollView를 상속한View에서 작업이 이루어져야 하는데 그렇다면ChattingView를UIView가 아닌UIScrollView로 구현하거나CollectionView안에ChatInputView를 add 해줘야 할까요??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.
ChattingView를 UIScrollView로 구현해보시면 좋을 것 같습니다ㅎㅎ