diff --git a/SanTa/SanTa.xcodeproj/xcshareddata/xcschemes/SanTa.xcscheme b/SanTa/SanTa.xcodeproj/xcshareddata/xcschemes/SanTa.xcscheme index ec66bd1..cf1c07a 100644 --- a/SanTa/SanTa.xcodeproj/xcshareddata/xcschemes/SanTa.xcscheme +++ b/SanTa/SanTa.xcodeproj/xcshareddata/xcschemes/SanTa.xcscheme @@ -67,7 +67,7 @@ diff --git a/SanTa/SanTa/Scenes/MountainDetailScene/MountainDetailViewController.swift b/SanTa/SanTa/Scenes/MountainDetailScene/MountainDetailViewController.swift index 3d7f45e..b9ba22f 100644 --- a/SanTa/SanTa/Scenes/MountainDetailScene/MountainDetailViewController.swift +++ b/SanTa/SanTa/Scenes/MountainDetailScene/MountainDetailViewController.swift @@ -11,8 +11,6 @@ import MapKit final class MountainDetailViewController: UIViewController { weak var coordinator: MountainDetailViewCoordinator? private var viewModel: MountainDetailViewModel? - private var mutatingTopConstraint: NSLayoutConstraint? - private let maxRollUpDistance: CGFloat = 50 private lazy var backButton: UIButton = { let button = UIButton(frame: .zero) @@ -76,19 +74,13 @@ extension MountainDetailViewController { mapSnapShot.heightAnchor.constraint(equalTo: headerView.heightAnchor, multiplier: 0.85) ]) - self.mutatingTopConstraint = titleView.topAnchor.constraint(equalTo: mapSnapShot.bottomAnchor) NSLayoutConstraint.activate([ + titleView.topAnchor.constraint(equalTo: mapSnapShot.bottomAnchor), titleView.leftAnchor.constraint(equalTo: headerView.leftAnchor), titleView.rightAnchor.constraint(equalTo: headerView.rightAnchor), titleView.heightAnchor.constraint(equalToConstant: self.view.bounds.height * 0.07) ]) - if let upperConstraint = self.mutatingTopConstraint { - NSLayoutConstraint.activate([ - upperConstraint - ]) - } - NSLayoutConstraint.activate([ tableView.topAnchor.constraint(equalTo: titleView.bottomAnchor), tableView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor), @@ -214,16 +206,6 @@ extension MountainDetailViewController: UITableViewDelegate, UITableViewDataSour } } -extension MountainDetailViewController: UIScrollViewDelegate { - func scrollViewDidScroll(_ scrollView: UIScrollView) { - let isBottom = scrollView.contentSize.height <= scrollView.bounds.height + scrollView.contentOffset.y - guard !isBottom else { return } - if scrollView.contentOffset.y > 0 && scrollView.contentOffset.y < self.maxRollUpDistance { - self.mutatingTopConstraint?.constant = -scrollView.contentOffset.y - } - } -} - extension MountainDetailViewController: MKMapViewDelegate { func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { guard let annotation = annotation as? MountainAnnotation else { return nil }