-
Notifications
You must be signed in to change notification settings - Fork 1
[5주차 트러블 슈팅] 홍성준
SungJun Hong edited this page Dec 11, 2023
·
1 revision
- iOS 에서 제공하는 왼쪽 끝을 Swipe해서 이전 화면으로 가는 기능을 사용하지 못했음
- RIBs 구조가 뒤로 가기 후에 리블렛을 detach 해야 하기 때문에 구현하기 까다로웠음
- UINavigationControllerDelegate에 willPop 이라는 메소드가 존재하는가?
- 기존의 pop 동작은 단순히 NavigationController의 pop을 호출하였는데 ViewController를 추가하여 해당 ViewController와 동일하면 pop 되도록 하기
- Pop 동작에 ViewController를 넣어 Pop될 ViewController와 동일한 객체인지 확인하기
- 만약 스와이프로 ViewController가 사라지고 detach 메소드가 호출되면 pop을 두 번 호출하였음
- 따라서 pop 동작에 ViewController를 넣어 ViewController가 없는 상태에서 detach가 호출되어도 ViewController는 제거하지 않고 (이미 제거되었으므로) 리블렛을 detach 하도록 구현하였음
- 위의 방식을 깔끔하게 동작시키기
- 위 동작을 Router의 Extension으로 추가하여 attachChild/detachChild까지 하도록 추가하였음
public extension ViewableRouting {
// MARK: - Attach
func presentRouter(
_ router: ViewableRouting,
animated: Bool,
isFullScreen: Bool = false,
completion: (() -> Void)? = nil
) {
viewControllable.present(router.viewControllable, animated: animated, isFullScreen: isFullScreen, completion: completion)
attachChild(router)
}
func pushRouter(_ router: ViewableRouting, animated: Bool) {
viewControllable.pushViewController(router.viewControllable, animated: animated)
attachChild(router)
}
func setRouters(_ routers: [ViewableRouting], animated: Bool) {
viewControllable.setViewControllers(routers.map(\.viewControllable), animated: animated)
routers.forEach(attachChild)
}
// MARK: - Detach
func dismissRouter(_ router: ViewableRouting, animated: Bool, completion: (() -> Void)? = nil) {
viewControllable.dismiss(animated: animated, completion: completion)
detachChild(router)
}
func popRouter(_ router: ViewableRouting, animted: Bool, completion: (() -> Void)? = nil) {
viewControllable.popViewController(router.viewControllable, animated: animted, completion: completion)
detachChild(router)
}
}
- 뒤로 가기 이벤트를 ViewController에서 Interactor로 전달하기
- 현재 앱에서 NavigationView라는 공통의 View를 통해 뒤로가기 기능을 사용하고 있었음
- BaseViewController를 추가하여 ViewController가 스와이프로 뒤로가기가 되었을 때 해당 NavigationView의 뒤로 가기 이벤트를 주어 해결하였음
open class BaseViewController: UIViewController {
public let navigationView = NavigationView()
public var cancellables = Set<AnyCancellable>()
open override func viewDidLoad() {
super.viewDidLoad()
setupLayout()
setupAttributes()
bind()
}
open override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
if isMovingFromParent {
navigationView.sendCloseEvent()
}
}
open func setupLayout() {}
open func setupAttributes() {}
open func bind() {}
}
- DB 선택 과정
- TypeORM 선택 이유
- Docker 선택 이유
- Github Action 선택 이유
- DB서버와 서비스 서버를 분리한 이유
- 자동완성을 위한 Trie 구조를 제거하고, naver cloud search로 대체한 이유
- 11월 07일 (화) - 프로젝트 설명
- 11월 16일 (목) - 프로젝트 진행하면서 생긴 고민
- 11월 21일 (화) - 멘토분들 피드백
- 11월 28일 (화) - 트러블 슈팅 피드백
- 12월 05일 (화) - 기술적 도전에 대한 고민
- 12월 12일 (화) - 최종 발표 피드백