[refactor/#282] SolplyDropDown 재사용성 높이기#283
Merged
Conversation
1 task
SeungWon1125
requested changes
Oct 6, 2025
Comment on lines
+48
to
+63
| init( | ||
| title: String, | ||
| options: [String], | ||
| selectedText: String? = nil, | ||
| onSelect: ((String) -> Void)? = nil | ||
| ) { | ||
| self.title = title | ||
| self.selectedText = selectedText | ||
| self.onSelectText = onSelect | ||
| self.selectedTag = nil | ||
| self.onSelectTag = nil | ||
|
|
||
| var seen = Set<String>() | ||
| let merged = ([title] + options).filter { seen.insert($0).inserted } | ||
| self.options = merged.map { .text($0) } | ||
| } |
| Rectangle() | ||
| .fill(Color(.gray200)) | ||
| .frame(height: 52.adjustedHeight) | ||
| .cornerRadius(16.adjustedHeight, corners: [.topLeft, .topRight]) |
Collaborator
There was a problem hiding this comment.
cornerRadius 에 기기대응 안 해도 될듯! 다른 것도 수정해 주세요
pedro0527
requested changes
Oct 6, 2025
| options: [String], | ||
| selectedText: String? = nil, | ||
| onSelect: ((String) -> Void)? = nil | ||
| ) { |
| .lineLimit(1) | ||
| .truncationMode(.tail) | ||
|
|
||
| Spacer(minLength: 0) |
Contributor
There was a problem hiding this comment.
우하하 처음봄 이거
근데 언제 써야하나여 이건 0으로 줄꺼면...?
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.
📄 작업 내용
String/아이콘+텍스트둘다 공통으로 사용할 수 있도록 변경💻 주요 코드 설명
드롭다운 사용법
MainTagType을 바로 데려올 수 있어서 저렇게 쓰면 됩니다!dropFirst())쓴 이유는 제일 처음 '전체'는 빠지길래 앞부분 빼는 거 넣었어여애니메이션
withAnimation안에 어떤 효과 넣을 건지 적어야한다잉...🔗 연결된 이슈
📚 제가 이거하면서 한 삽질
옵션이 String일 때도 있고, 아이콘+텍스트일 때도 있으나깐!! 타입에 구애받지 않도록
제네릭을 쓰려고 했다가 망한 이야기... 노션 트슈에 적어놧슴ㄴ디ㅏ 많관부제네릭을 쓰고 시펏는데 못써요