Вывести задержку в центр в MKMapView при изменении высоты MKMapView - PullRequest
0 голосов
/ 17 января 2019

вот ссылка на дропбокс https://www.dropbox.com/s/w55tng7h81m0wss/ScreenRecording_01-17-2019%2016-24-21.MP4?dl=0

вот мои ограничения введите описание изображения здесь

Пин или аннотация получают задержку в битах при уменьшении высоты MKMapView, я установил ограничения Больше, чем равная высота с представлением ниже.

func manageOrderDetails (_ isVisible: Bool) {

    if isVisible {

        ctsscollViewHeight.priority = UILayoutPriority(rawValue: 999)
        ctsscollViewHeight.constant = 0
        self.seperateLineDownAddress.addshadow(top: false, left: false, bottom: false, right: false,shadowOpacity: 0.0,height:0.0)
        self.mapView.setNeedsUpdateConstraints()
        UIView.animate(withDuration: 0.6, delay: 0, options: .curveEaseInOut, animations: {
            self.view.layoutIfNeeded()
            self.orderDetailsContainer.alpha = 0.0
        }){ (isCompleted) in
            self.orderDetailsContainer.isHidden = true
        }
    }else{
        orderDetailsContainer.alpha = 0.0
        self.seperateLineDownAddress.addshadow(top: false, left: false, bottom: true, right: false,shadowOpacity: 0.15,height:1.0)
        if  orderDetailsContainer.frame.height > ((UIScreen.main.bounds.height) / 2) {
            ctsscollViewHeight.priority = UILayoutPriority(rawValue: 250)
        }else{
            ctsscollViewHeight.priority = UILayoutPriority(rawValue: 999)
        }
        ctsscollViewHeight.constant = self.orderDetailsContainer.frame.height
        self.mapView.setNeedsUpdateConstraints()
        UIView.animate(withDuration: 0.6, delay:0, options: .curveEaseInOut, animations: {
            self.orderDetailsContainer.alpha = 1.0
            self.orderDetailsContainer.isHidden = false
            self.view.layoutIfNeeded()
        })
    }
}
...