diff --git a/PLUV/Feed/FeedDetailViewController.swift b/PLUV/Feed/FeedDetailViewController.swift index cd6a055..66081b5 100644 --- a/PLUV/Feed/FeedDetailViewController.swift +++ b/PLUV/Feed/FeedDetailViewController.swift @@ -47,6 +47,8 @@ class FeedDetailViewController: UIViewController { } private var feedDetailTableViewHeightConstraint: NSLayoutConstraint! + private var saveView = MoveView(view: UIViewController()) + private let disposeBag = DisposeBag() init(viewModel: FeedViewModel) { @@ -67,6 +69,12 @@ class FeedDetailViewController: UIViewController { setFeedDetailMusicItemAPI() } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + /// 탭 바 숨기기 + self.tabBarController?.tabBar.isHidden = true + } + override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() setTableViewHeight() /// 레이아웃이 갱신될 때마다 테이블 뷰 높이 갱신 @@ -150,7 +158,6 @@ class FeedDetailViewController: UIViewController { /// 테이블 뷰 높이 제약 추가 feedDetailTableViewHeightConstraint = feedDetailTableView.heightAnchor.constraint(equalToConstant: 0) - feedDetailTableViewHeightConstraint.isActive = true /// ContentView의 마지막 요소와 ScrollView의 bottom을 맞추기 위한 제약 설정 feedDetailTableView.snp.makeConstraints { make in @@ -158,11 +165,20 @@ class FeedDetailViewController: UIViewController { } feedDetailTableView.isScrollEnabled = false /// 테이블 뷰 스크롤 비활성화 + + saveView = MoveView(view: self) + self.view.addSubview(saveView) + saveView.snp.makeConstraints { make in + make.leading.trailing.bottom.equalToSuperview() + make.height.equalTo(101) + } + + saveView.changeName(left: "저장", right: "플레이리스트 옮기기") } private func setTableViewHeight() { feedDetailTableView.layoutIfNeeded() /// 테이블 뷰 레이아웃 갱신 - let contentHeight = feedDetailTableView.contentSize.height + 30 /// 테이블 뷰 전체 셀 높이 + let contentHeight = feedDetailTableView.contentSize.height + 101 /// 테이블 뷰 전체 셀 높이 feedDetailTableViewHeightConstraint.constant = contentHeight /// 높이 제약 업데이트 /// 이미지 높이 + 테이블 뷰 높이를 합산하여 스크롤뷰의 contentSize 설정 diff --git a/PLUV/Feed/FeedViewController.swift b/PLUV/Feed/FeedViewController.swift index 881774c..39c4ebc 100644 --- a/PLUV/Feed/FeedViewController.swift +++ b/PLUV/Feed/FeedViewController.swift @@ -41,10 +41,12 @@ class FeedViewController: UIViewController { setFeedAPI() } - override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.setNavigationBarHidden(true, animated: false) + + /// 탭 바 표시하기 + self.tabBarController?.tabBar.isHidden = false } override func viewWillDisappear(_ animated: Bool) {