here is drop box link https://www.dropbox.com/s/w55tng7h81m0wss/ScreenRecording_01-17-2019%2016-24-21.MP4?dl=0
here is my constraints enter image description here
pin or annotation get bit delay while decrease height of MKMapView ,I had set constrains Greater then equal height with below view .
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()
})
}
}