Style/#365 나의여정 UI 및 WriteQuestVC 리팩토링#382
Merged
Conversation
|
부들부들 텍필 기대되네여~~~~~ |
dev-domo
approved these changes
Feb 25, 2026
Collaborator
dev-domo
left a comment
There was a problem hiding this comment.
정말정말 고생하셨습니다. QuestScope 잘 추가해주셨네요!
|
|
||
| import UIKit | ||
|
|
||
| protocol WriteQuestBaseProtocol where Self: UIView { |
juri123123
approved these changes
Feb 26, 2026
| @@ -31,19 +28,19 @@ final class WriteActiveTypeQuestView: BaseView { | |||
| private let grayTag = ByeBooFilledTag(tagType: .smallGray, text: "선택") | |||
| private let thinkTitleLabel = UILabel() | |||
| private(set) var questTextField = QuestTextField(type: .activation) | |||
| private(set) var confirmButton = ByeBooButton(titleText: "완료하기", type: .disabled) | |||
Collaborator
Author
There was a problem hiding this comment.
버튼이 사라지고 네비게이션바로 옮겨갔습니다 !!
| var questTextView: UITextView { | ||
| questTextField.textView | ||
| } | ||
|
|
| final class WriteActiveTypeQuestViewController: BaseViewController { | ||
|
|
||
| private let rootView = WriteActiveTypeQuestView() | ||
| final class WriteActiveTypeQuestViewController: WriteQuestBaseViewController<WriteActiveTypeQuestView> { |
| } | ||
|
|
||
| class WriteQuestBaseViewController<RootView: BaseView & WriteQuestBaseProtocol>: | ||
| BaseViewController, UIGestureRecognizerDelegate, BackNavigable { |
Collaborator
There was a problem hiding this comment.
사용하는 extension에서 채택해주고 나눠주면 좋을 것 같아용
Collaborator
Author
There was a problem hiding this comment.
저도 익스텐션으로 나누고 싶었는데 .. 제네릭 클래스여서 extension에서 @objc를 붙이는건 지원이 따로 안되는 것 같아요 .. 에러가 나네요 ㅠㅠ
Conformance of generic class 'WriteQuestBaseViewController<RootView>' to @objc protocol 'BackNavigable' cannot be in an extension
Comment on lines
+137
to
+147
| func adjustViewForKeyboard(mode: KeyboardAdjustMode) { | ||
| guard isKeyboardUsed else { return } | ||
| guard !keyboardFrameInWindow.isEmpty else { return } | ||
|
|
||
| switch mode { | ||
| case .textGrowth: | ||
| adjustViewForTextGrowth() | ||
| case .caretTracking: | ||
| adjustViewForCurrentCaret() | ||
| } | ||
| } |
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
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.
🔗 연결된 이슈
📄 작업 내용
Complete~View,Archive에서 사용되었던 컴포넌트들)영상을 다시 찍기가 귀찮은데 부들부들한 텍스트필드가 될 수 있도록 리팩토링했습니다. 기존에 QuestionType은 스크롤뷰 없이 뷰를 구현했는데 ScrollView로 UI를 바꿨습니다!!
+) 근데 소희언니가 피알 염탐하고 이거 틀렷다고 알려줘서 키보드 위에 text count label 오도록 수정햇슴다 ^^*!!
2026.02.27 최종
💻 주요 코드 설명
WriteQuestBaseViewController
ActiveType VC와 QuestionType VC는 앱잼때부터 가져오던 역사가 긴 친구들로... 점점 기능이 추가되고, 공통된 로직도 많다보니 뷰컨트롤러 코드를 보기가 너무 힘들더라구요... 그래서 공통된 로직은 따로 WriteQuestBaseVC에 넣어 상속받도록 했습니다.
WriteQuestBaseProtocol은 View에서 채택하는 프로토콜로, 부모 뷰컨에서 필요한 컴포넌트를 가져오는 역할을 합니다.
이곳에는 키보드 관련 로직이 들어있습니다! 또한 공통되는 objc 함수들이 포함되어있습니다.
키보드 대응
새롭게 바뀐 키보드 대응방식을 반영했습니다.
TextGrowth 함수CaretRect 함수CaretRect은 저도 처음 알게 되었는데 현재 커서 위치의 삽입 좌표점이라고 합니다 !!
공통 여정 분기처리
공통 질문의 경우, 질문형 퀘스트밖에 존재하지 않고 + questNumber가 nil 이라고 합니다. 그래서 configure에 있는 questNumber를 옵셔널로 바꿔주었습니다. (shout out 개맹님) 옵셔널인지에 따라 questScope라는 값으로 구분하게 됩니다!
UITextView 높이 동적대응
AS-IS
TO-BE
ByeBooNavigationBar 타입 추가
퀘스트 작성 부분의 네비게이션바 타입이 기존에는 없던 case여서
confirmAndBack이라는 case를 추가했습니다.또한, 텍스트의 bar Appearance를 지정해주었고, makeBarItem에 이미지 뿐만 아니라 String으로도 아이템을 만들 수 있도록 파라미터를 수정했습니다. 확장성있는 컴포넌트..개맹업개맹업
이에 따라 confirm Button을 텍스트필드에 입력된 값에 따라 update해주던 함수를 사용하지 않고, 대신 navigationItem에 접근하여 isEnabled를 t/f로 바꿔주는 방식을 사용합니다.