[Feat/#417] UIkit -> SwiftUI 마이그레이션#418
Open
Conversation
JinUng41
approved these changes
Aug 9, 2025
Contributor
JinUng41
left a comment
There was a problem hiding this comment.
고생하셨습니다!
이런 걸 보니, 저도 스유가 해보고 싶어지네요.
Comment on lines
+20
to
+27
| SettingRow( | ||
| title: "버전정보", | ||
| subtitle: "1.0.2", | ||
| action: { | ||
| print("버전정보 탭됨") | ||
| } | ||
| ) | ||
| .frame(height: (geometry.size.height - 44 - 48) / 5) // padding 44, spacing 48 |
Contributor
There was a problem hiding this comment.
반복적인 SettingRow를 생성하는 코드들을 줄일 수 있는 방법이 있을까요?
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.
🔗 연결된 이슈
📄 작업 내용
💻 주요 코드 설명
RxSwift와 SwiftUI의 데이터 바인딩 통합
문제점: RxSwift BehaviorRelay vs SwiftUI @ObservedObject
기존 UIKit + RxSwift 코드
문제 상황
SwiftUI의 @ObservedObject는 Combine의 ObservableObject 프로토콜을 준수해야
하는데, RxSwift의 BehaviorRelay는 준수안함 (당연함)
해결책: Wrapper 패턴으로 브리징
[ObservableObject](https://developer.apple.com/documentation/combine/observableobject) 를 써서 Wrapper 클래스로 해결핑
UIHostingController 통합
문제점: 네비게이션 구조 유지
https://developer.apple.com/documentation/swiftui/uihostingcontroller
1. 전체 교체 (했다가 실패함ㅠ)
문제는 BaseViewController의 기능 상실, 네비게이션 바 커스터마이징 어려워지게 되더라구요
해서 안되니까 Child View Controller 채택
문제점: fillEqually Distribution 구현
https://developer.apple.com/documentation/swiftui/geometryreader
기존코드
GeometryReader로 바로 정상
네비게이션 로직은 UIkit이 뷰만 SwiftUI에서
SwiftUI에서 UIKit ViewController Push를 유지해야 하는 상황 [참고](https://developer.apple.com/documentation/swiftui/uiviewcontrollerrepresentable)
네비게이션 로직: UIKit (UINavigationController, push/pop 등)
구체적인 구조
Equatable 프로토콜 추가
문제점: [onChange](https://developer.apple.com/documentation/swiftui/view/onchange(of:perform:)) 모디파이어 사용 시 필요
👀 기타 더 이야기해볼 점
마이그레이션은 하나씩 천천히 해야겟어요 간단한뷰라 쉬울줄알앗는데 개헷갈림;;